blob_id stringlengths 40 40 | __id__ int64 225 39,780B | directory_id stringlengths 40 40 | path stringlengths 6 313 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_name stringlengths 6 132 | repo_url stringlengths 25 151 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 70 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 7.28k 689M ⌀ | star_events_count int64 0 131k | fork_events_count int64 0 48k | gha_license_id stringclasses 23
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 40.4M ⌀ | gha_stargazers_count int32 0 112k ⌀ | gha_forks_count int32 0 39.4k ⌀ | gha_open_issues_count int32 0 11k ⌀ | gha_language stringlengths 1 21 ⌀ | gha_archived bool 2
classes | gha_disabled bool 1
class | content stringlengths 7 4.37M | src_encoding stringlengths 3 16 | language stringclasses 1
value | length_bytes int64 7 4.37M | extension stringclasses 24
values | filename stringlengths 4 174 | language_id stringclasses 1
value | entities list | contaminating_dataset stringclasses 0
values | malware_signatures list | redacted_content stringlengths 7 4.37M | redacted_length_bytes int64 7 4.37M | alphanum_fraction float32 0.25 0.94 | alpha_fraction float32 0.25 0.94 | num_lines int32 1 84k | avg_line_length float32 0.76 99.9 | std_line_length float32 0 220 | max_line_length int32 5 998 | is_vendor bool 2
classes | is_generated bool 1
class | max_hex_length int32 0 319 | hex_fraction float32 0 0.38 | max_unicode_length int32 0 408 | unicode_fraction float32 0 0.36 | max_base64_length int32 0 506 | base64_fraction float32 0 0.5 | avg_csv_sep_count float32 0 4 | is_autogen_header bool 1
class | is_empty_html bool 1
class | shard stringclasses 16
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a7e1d62622274b2c1f0016db6afbb3ec5ffdabac | 38,895,223,868,279 | 947ec86272526ef7494b8aae511bcbac3ddcbfe1 | /Algorithms/cracking_the_coding_interview/Practise_coding/SortList.java | 7337c3c6997cba2705d809d74a4b95ff4e97785e | [] | no_license | mynamerahulkumar/GitHub | https://github.com/mynamerahulkumar/GitHub | 4e49a88ac7e945b334563679fbd38e5763a80b29 | 04892c689a4007119ba02b1d6545bee334b7192b | refs/heads/master | 2023-08-10T06:04:52.334000 | 2023-07-17T18:18:03 | 2023-07-17T18:18:03 | 144,650,884 | 0 | 0 | null | false | 2022-12-16T06:47:39 | 2018-08-14T01:09:39 | 2021-12-30T07:44:33 | 2022-12-16T06:47:36 | 326,825 | 0 | 0 | 30 | Jupyter Notebook | false | false | import java.util.List;
public class SortList {
class ListNode{
public int val;
public ListNode next;
ListNode(int x){
val=x;
next=null;
}
}
public ListNode head=null;
public ListNode tail=null;
public void addNode(int a){
ListNode newNode=new ListNode(a);
if(head==null){
head=newNode;
tail=newNode;
}
else{
tail.next=newNode;
tail=newNode;
}
}
public ListNode sortList(ListNode A) {
/*
1.Use merge sort
2.First divide the array into two parts from middile
3.o to mid nd mid_1 to n;
4.Do step 3 and step 2 in recursive
5.return merge(A,B)
*/
ListNode head=A;
if(head==null || head.next==null){
return head;
}
ListNode mid=getMid(head);
if(mid.next==null) head.next=null;
ListNode x=head;
ListNode y=mid.next;
mid.next=null;
x=sortList(x);
y= sortList(y);
return merge(x,y);
}
public ListNode getMid(ListNode B){
ListNode h=B;
if(h==null ||h.next==null){
return h;
}
ListNode slow=h;
ListNode fast=h;
while(slow!=null && fast!=null && fast.next!=null){
slow=slow.next;
fast=fast.next.next;
}
return slow;
}
public ListNode merge(ListNode x,ListNode y){
ListNode headA=x;
ListNode headB=y;
ListNode head=null;
if(headA==null){
return headB;
}
if(headB==null){
return headA;
}
if(headA.val<headB.val){
head=headA;
headA=headA.next;
}
else{
head=headB;
headB=headB.next;
}
ListNode t=head;
while(headA!=null && headB!=null){
if(headA.val<headB.val){
t.next=headA;
t=headA;
headA=headA.next;
}
else{
t.next=headB;
t=headB;
headB=headB.next;
}
}
if(headA!=null){
t.next=headA;
}
if(headB!=null){
t.next=headB;
}
return head;
}
public static void main(String[] args) {
SortList list=new SortList();
list.addNode(3);
list.addNode(4);
list.addNode(2);
list.addNode(8);
list.sortList(list.head);
}
}
| UTF-8 | Java | 2,615 | java | SortList.java | Java | [] | null | [] | import java.util.List;
public class SortList {
class ListNode{
public int val;
public ListNode next;
ListNode(int x){
val=x;
next=null;
}
}
public ListNode head=null;
public ListNode tail=null;
public void addNode(int a){
ListNode newNode=new ListNode(a);
if(head==null){
head=newNode;
tail=newNode;
}
else{
tail.next=newNode;
tail=newNode;
}
}
public ListNode sortList(ListNode A) {
/*
1.Use merge sort
2.First divide the array into two parts from middile
3.o to mid nd mid_1 to n;
4.Do step 3 and step 2 in recursive
5.return merge(A,B)
*/
ListNode head=A;
if(head==null || head.next==null){
return head;
}
ListNode mid=getMid(head);
if(mid.next==null) head.next=null;
ListNode x=head;
ListNode y=mid.next;
mid.next=null;
x=sortList(x);
y= sortList(y);
return merge(x,y);
}
public ListNode getMid(ListNode B){
ListNode h=B;
if(h==null ||h.next==null){
return h;
}
ListNode slow=h;
ListNode fast=h;
while(slow!=null && fast!=null && fast.next!=null){
slow=slow.next;
fast=fast.next.next;
}
return slow;
}
public ListNode merge(ListNode x,ListNode y){
ListNode headA=x;
ListNode headB=y;
ListNode head=null;
if(headA==null){
return headB;
}
if(headB==null){
return headA;
}
if(headA.val<headB.val){
head=headA;
headA=headA.next;
}
else{
head=headB;
headB=headB.next;
}
ListNode t=head;
while(headA!=null && headB!=null){
if(headA.val<headB.val){
t.next=headA;
t=headA;
headA=headA.next;
}
else{
t.next=headB;
t=headB;
headB=headB.next;
}
}
if(headA!=null){
t.next=headA;
}
if(headB!=null){
t.next=headB;
}
return head;
}
public static void main(String[] args) {
SortList list=new SortList();
list.addNode(3);
list.addNode(4);
list.addNode(2);
list.addNode(8);
list.sortList(list.head);
}
}
| 2,615 | 0.462333 | 0.457744 | 109 | 22.990826 | 12.301634 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.568807 | false | false | 7 |
4c25e7130614f31ee8175b5381d5cbf8daf54fa1 | 35,287,451,344,434 | 43fc57e9078edcf5289ad81c7deeefad7d05daf7 | /app/src/main/java/com/whzl/mengbi/ui/view/UserInfoView.java | 9af063afb650bcee85264b29d0ab0f9789a7d3d8 | [] | no_license | tiangt/MB | https://github.com/tiangt/MB | 51ac7ffb776e7a2ffded034d1a159e85f8fddbc5 | 45b551f0594aaea8fd1250b9861573cbbf30dd22 | refs/heads/master | 2021-01-02T15:50:39.674000 | 2019-12-11T03:07:10 | 2019-12-11T03:07:10 | 239,680,624 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.whzl.mengbi.ui.view;
public interface UserInfoView {
void showPortrait(String filename);
void showSuccess(String msg);
void showError(String msg);
void onModifyNickname(String nickname);
void onSignSuccess(String sign);
}
| UTF-8 | Java | 259 | java | UserInfoView.java | Java | [] | null | [] | package com.whzl.mengbi.ui.view;
public interface UserInfoView {
void showPortrait(String filename);
void showSuccess(String msg);
void showError(String msg);
void onModifyNickname(String nickname);
void onSignSuccess(String sign);
}
| 259 | 0.733591 | 0.733591 | 13 | 18.923077 | 17.643745 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false | 7 |
af0a2a2b9dbc1fc9ba8d03ee12761d836a9173fa | 34,789,235,141,313 | da3ef6b61d063bb018fb5a12fb1a8e5a2a9e49db | /4.JavaCollections/src/com/javarush/task/task32/task3212/ServiceLocator.java | 5e240fc6f4a492d47a157f2d2a489e500d3f7e56 | [] | no_license | men123123men/JavaRush | https://github.com/men123123men/JavaRush | ca348e03a98c20888adf90a448522bdfb51bd196 | 92058395906d248c3f8b35a5a8988dd48eb6ae31 | refs/heads/master | 2021-09-07T13:11:01.448000 | 2018-02-23T08:32:11 | 2018-02-23T08:32:11 | 119,760,785 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.javarush.task.task32.task3212;
import com.javarush.task.task32.task3212.contex.InitialContext;
import com.javarush.task.task32.task3212.service.Service;
import java.util.Objects;
public class ServiceLocator {
private static Cache cache = new Cache();
private static InitialContext context = new InitialContext();
public static Service getService(String jndiName) {
Service result = cache.getService(jndiName);
if (Objects.isNull(result))
result = (Service) context.lookup(jndiName);
cache.addService(result);
return result;
}
}
| UTF-8 | Java | 605 | java | ServiceLocator.java | Java | [] | null | [] | package com.javarush.task.task32.task3212;
import com.javarush.task.task32.task3212.contex.InitialContext;
import com.javarush.task.task32.task3212.service.Service;
import java.util.Objects;
public class ServiceLocator {
private static Cache cache = new Cache();
private static InitialContext context = new InitialContext();
public static Service getService(String jndiName) {
Service result = cache.getService(jndiName);
if (Objects.isNull(result))
result = (Service) context.lookup(jndiName);
cache.addService(result);
return result;
}
}
| 605 | 0.719008 | 0.689256 | 20 | 29.25 | 23.744209 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 7 |
63c39843f5f64fc4a87a85a560fbeecc9f3a4d5d | 33,809,982,601,800 | 63c60383d5210480303021ff1287026524cf8153 | /BabaFoodMenuItems/src/main/java/com/repo/MenuRepo.java | ebe0ad31f9e75abb4735d5fdb6c6b820b2e24dc0 | [] | no_license | vkm94/foodAppp | https://github.com/vkm94/foodAppp | e03301624dfeaf539e57045b8ca63e38c0836e3a | d25113ae8698ff82decc041654d06cb40ec2e11b | refs/heads/master | 2023-08-17T01:00:15.605000 | 2021-09-24T19:41:02 | 2021-09-24T19:41:02 | 409,484,952 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.repo;
import org.springframework.data.repository.CrudRepository;
import com.entity.Menu;
public interface MenuRepo extends CrudRepository<Menu, String> {
}
| UTF-8 | Java | 181 | java | MenuRepo.java | Java | [] | null | [] | package com.repo;
import org.springframework.data.repository.CrudRepository;
import com.entity.Menu;
public interface MenuRepo extends CrudRepository<Menu, String> {
}
| 181 | 0.767956 | 0.767956 | 9 | 18.111111 | 24.328512 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 7 |
e1f74470881e076fd09ad24615061e8285e94040 | 39,333,310,526,148 | d4382592a545af5bbd0829d51a035f9f3a357b6b | /src/main/java/com/project/crm/backend/repository/medicalHistoryCatalogRepo/DiagnoseResultRepo.java | 2637b6177717f5ad87a2c3a84fd853ace5aadf09 | [] | no_license | 95shuma/crm | https://github.com/95shuma/crm | 256854320f68e34314face8e6f7b2ec822ec6583 | 23f32149dda2d2eae6bf565ce8e61c25bd9f4b15 | refs/heads/master | 2022-12-04T15:05:54.269000 | 2020-08-18T17:53:28 | 2020-08-18T17:53:28 | 267,604,563 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.project.crm.backend.repository.medicalHistoryCatalogRepo;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.Diagnose;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.DiagnoseResult;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.Direction;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface DiagnoseResultRepo extends JpaRepository<DiagnoseResult, Long> {
Page<DiagnoseResult> findAllByMedicalHistoryId(Long id, Pageable pageable);
}
| UTF-8 | Java | 630 | java | DiagnoseResultRepo.java | Java | [] | null | [] | package com.project.crm.backend.repository.medicalHistoryCatalogRepo;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.Diagnose;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.DiagnoseResult;
import com.project.crm.backend.model.catalog.medicalHistoryCatalog.Direction;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface DiagnoseResultRepo extends JpaRepository<DiagnoseResult, Long> {
Page<DiagnoseResult> findAllByMedicalHistoryId(Long id, Pageable pageable);
}
| 630 | 0.857143 | 0.857143 | 12 | 51.5 | 31.789673 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.833333 | false | false | 7 |
042639a1fa79ee3ecb1f8421b4c09b336af8f8d1 | 4,063,039,127,586 | 8c6dffbf5d1e50eef7acb045ba5a9fac8c250e4d | /src/jsrc/org/erights/e/elang/syntax/antlr/EALexerTokenTypes.java | f7c79f2fb06c6c96118f2f6d2d46dae6749164de | [
"MIT"
] | permissive | kpreid/e-on-java | https://github.com/kpreid/e-on-java | 772ff733da7d76cafbe74f766cd8bee1853ce544 | a0b3b599cf267b3138eea5f5fb83f27cebd28373 | refs/heads/master | 2016-09-06T16:19:08.103000 | 2011-10-26T11:56:25 | 2011-10-26T11:56:25 | 3,462,719 | 3 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | // $ANTLR 2.7.5rc2 (2005-01-08): "elex.g" -> "EALexer.java"$
package org.erights.e.elang.syntax.antlr;
public interface EALexerTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int QUASIOPEN = 4;
int QUASICLOSE = 5;
int QUASIBODY = 6;
int QuasiContent = 7;
int RCURLY = 8;
int DOLLARHOLE = 9;
int ATHOLE = 10;
int DOLLARCURLY = 11;
int ATCURLY = 12;
int DOLLARESC = 13;
int AssignExpr = 14;
int CallExpr = 15;
int IntoExpr = 16;
int EscapeExpr = 17;
int HideExpr = 18;
int IfExpr = 19;
int ForExpr = 20;
int WhenExpr = 21;
int AndExpr = 22;
int OrExpr = 23;
int CoerceExpr = 24;
int LiteralExpr = 25;
int MatchBindExpr = 26;
int NounExpr = 27;
int ObjectExpr = 28;
int InterfaceExpr = 29;
int QuasiLiteralExpr = 30;
int QuasiPatternExpr = 31;
int MetaStateExpr = 32;
int MetaContextExpr = 33;
int SeqExpr = 34;
int SlotExpr = 35;
int MetaExpr = 36;
int CatchExpr = 37;
int FinallyExpr = 38;
int ReturnExpr = 39;
int ContinueExpr = 40;
int BreakExpr = 41;
int WhileExpr = 42;
int SwitchExpr = 43;
int TryExpr = 44;
int MapPattern = 45;
int LiteralPattern = 46;
int TupleExpr = 47;
int MapExpr = 48;
int BindPattern = 49;
int SendExpr = 50;
int CurryExpr = 51;
int FinalPattern = 52;
int VarPattern = 53;
int SlotPattern = 54;
int ListPattern = 55;
int CdrPattern = 56;
int IgnorePattern = 57;
int SuchThatPattern = 58;
int QuasiLiteralPattern = 59;
int QuasiPatternPattern = 60;
int URI = 61;
int URIStart = 62;
int URIGetter = 63;
int URIExpr = 64;
int LambdaExpr = 65;
int EScript = 66;
int EMethod = 67;
int EMatcher = 68;
int List = 69;
int WhenFn = 70;
int HEX = 71;
int OCTAL = 72;
int WS = 73;
int LINESEP = 74;
int SL_COMMENT = 75;
int DOC_COMMENT = 76;
int CHAR_LITERAL = 77;
int STRING = 78;
int ESC = 79;
int HEX_DIGIT = 80;
int IDENT = 81;
int INT = 82;
int POSINT = 83;
int FLOAT64 = 84;
int EXPONENT = 85;
// ";" = 86
int LITERAL_pragma = 87;
// "." = 88
int LITERAL_meta = 89;
int LITERAL_if = 90;
int LITERAL_else = 91;
int LITERAL_for = 92;
int LITERAL_in = 93;
// "=>" = 94
int LITERAL_accum = 95;
int LITERAL_while = 96;
// "{" = 97
int LITERAL__ = 98;
// "+" = 99
// "*" = 100
// "&" = 101
// "|" = 102
int LITERAL_when = 103;
// "->" = 104
int LITERAL_finally = 105;
// ":" = 106
int LITERAL_escape = 107;
int LITERAL_thunk = 108;
int LITERAL_fn = 109;
int LITERAL_switch = 110;
int LITERAL_try = 111;
int LITERAL_bind = 112;
int LITERAL_var = 113;
int LITERAL_def = 114;
// ":=" = 115
// "(" = 116
// "," = 117
// ")" = 118
int LITERAL_extends = 119;
int LITERAL_implements = 120;
int LITERAL_to = 121;
int LITERAL_method = 122;
int LITERAL_on = 123;
int LITERAL_match = 124;
int LITERAL_throws = 125;
int LITERAL_interface = 126;
int LITERAL_guards = 127;
// "=" = 128
// "//=" = 129
// "+=" = 130
// "-=" = 131
// "*=" = 132
// "/=" = 133
// "%=" = 134
// "%%=" = 135
// "**=" = 136
// ">>=" = 137
// "<<=" = 138
// "&=" = 139
// "^=" = 140
// "|=" = 141
int LITERAL_break = 142;
int LITERAL_continue = 143;
int LITERAL_return = 144;
// "^" = 145
// "||" = 146
// "&&" = 147
// "==" = 148
// "!=" = 149
// "&!" = 150
// "=~" = 151
// "!~" = 152
// "<" = 153
// "<=" = 154
// "<=>" = 155
// ">=" = 156
// ">" = 157
// ".." = 158
// "..!" = 159
// "<<" = 160
// ">>" = 161
// "-" = 162
// "/" = 163
// "//" = 164
// "%" = 165
// "%%" = 166
// "**" = 167
// "!" = 168
// "~" = 169
// "[" = 170
// "]" = 171
// "<-" = 172
// "::" = 173
int LITERAL_catch = 174;
// "?" = 175
// "${" = 176
// "$" = 177
// "$$" = 178
// "@{" = 179
// "@" = 180
int LITERAL_abstract = 181;
int LITERAL_an = 182;
int LITERAL_as = 183;
int LITERAL_assert = 184;
int LITERAL_attribute = 185;
int LITERAL_be = 186;
int LITERAL_begin = 187;
int LITERAL_behalf = 188;
int LITERAL_belief = 189;
int LITERAL_believe = 190;
int LITERAL_believes = 191;
int LITERAL_case = 192;
int LITERAL_class = 193;
int LITERAL_const = 194;
int LITERAL_constructor = 195;
int LITERAL_datatype = 196;
int LITERAL_declare = 197;
int LITERAL_default = 198;
int LITERAL_define = 199;
int LITERAL_defmacro = 200;
int LITERAL_delicate = 201;
int LITERAL_deprecated = 202;
int LITERAL_dispatch = 203;
int LITERAL_do = 204;
int LITERAL_encapsulate = 205;
int LITERAL_encapsulated = 206;
int LITERAL_encapsulates = 207;
int LITERAL_end = 208;
int LITERAL_ensure = 209;
int LITERAL_enum = 210;
int LITERAL_eventual = 211;
int LITERAL_eventually = 212;
int LITERAL_export = 213;
int LITERAL_facet = 214;
int LITERAL_forall = 215;
int LITERAL_fun = 216;
int LITERAL_function = 217;
int LITERAL_given = 218;
int LITERAL_hidden = 219;
int LITERAL_hides = 220;
int LITERAL_inline = 221;
int LITERAL_know = 222;
int LITERAL_knows = 223;
int LITERAL_lambda = 224;
int LITERAL_let = 225;
int LITERAL_methods = 226;
int LITERAL_namespace = 227;
int LITERAL_native = 228;
int LITERAL_obeys = 229;
int LITERAL_octet = 230;
int LITERAL_oneway = 231;
int LITERAL_operator = 232;
int LITERAL_package = 233;
int LITERAL_private = 234;
int LITERAL_protected = 235;
int LITERAL_public = 236;
int LITERAL_raises = 237;
int LITERAL_reliance = 238;
int LITERAL_reliant = 239;
int LITERAL_relies = 240;
int LITERAL_rely = 241;
int LITERAL_reveal = 242;
int LITERAL_sake = 243;
int LITERAL_signed = 244;
int LITERAL_static = 245;
int LITERAL_struct = 246;
int LITERAL_suchthat = 247;
int LITERAL_supports = 248;
int LITERAL_suspect = 249;
int LITERAL_suspects = 250;
int LITERAL_synchronized = 251;
int LITERAL_this = 252;
int LITERAL_transient = 253;
int LITERAL_truncatable = 254;
int LITERAL_typedef = 255;
int LITERAL_unsigned = 256;
int LITERAL_unum = 257;
int LITERAL_uses = 258;
int LITERAL_using = 259;
// "utf8" = 260
// "utf16" = 261
int LITERAL_virtual = 262;
int LITERAL_volatile = 263;
int LITERAL_wstring = 264;
int SR = 265;
int GE = 266;
int SR_ASSIGN = 267;
int LPAREN = 268;
int RPAREN = 269;
int LBRACK = 270;
int RBRACK = 271;
int LCURLY = 272;
int AT = 273;
int QUESTION = 274;
int COLON = 275;
int COMMA = 276;
int DOT = 277;
int THRU = 278;
int TILL = 279;
int SAME = 280;
int EQ = 281;
int LNOT = 282;
int BNOT = 283;
int NOTSAME = 284;
int DIV = 285;
int FLOORDIV = 286;
int PLUS = 287;
int MINUS = 288;
int INC = 289;
int DEC = 290;
int STAR = 291;
int REM = 292;
int MOD = 293;
int SL = 294;
int LE = 295;
int ABA = 296;
int BXOR = 297;
int BOR = 298;
int LOR = 299;
int BAND = 300;
int BUTNOT = 301;
int LAND = 302;
int SEMI = 303;
int POW = 304;
int ASSIGN = 305;
int FLOORDIV_ASSIGN = 306;
int DIV_ASSIGN = 307;
int PLUS_ASSIGN = 308;
int MINUS_ASSIGN = 309;
int STAR_ASSIGN = 310;
int REM_ASSIGN = 311;
int MOD_ASSIGN = 312;
int POW_ASSIGN = 313;
int SL_ASSIGN = 314;
int BXOR_ASSIGN = 315;
int BOR_ASSIGN = 316;
int BAND_ASSIGN = 317;
int SEND = 318;
int WHEN = 319;
int MAPSTO = 320;
int MATCHBIND = 321;
int MISMATCH = 322;
int SCOPE = 323;
int SCOPESLOT = 324;
int GT = 325;
int LT = 326;
int ESCWS = 327;
int ANYWS = 328;
int SKIPLINE = 329;
int UPDOC = 330;
int BR = 331;
int EOL = 332;
}
| UTF-8 | Java | 7,207 | java | EALexerTokenTypes.java | Java | [] | null | [] | // $ANTLR 2.7.5rc2 (2005-01-08): "elex.g" -> "EALexer.java"$
package org.erights.e.elang.syntax.antlr;
public interface EALexerTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int QUASIOPEN = 4;
int QUASICLOSE = 5;
int QUASIBODY = 6;
int QuasiContent = 7;
int RCURLY = 8;
int DOLLARHOLE = 9;
int ATHOLE = 10;
int DOLLARCURLY = 11;
int ATCURLY = 12;
int DOLLARESC = 13;
int AssignExpr = 14;
int CallExpr = 15;
int IntoExpr = 16;
int EscapeExpr = 17;
int HideExpr = 18;
int IfExpr = 19;
int ForExpr = 20;
int WhenExpr = 21;
int AndExpr = 22;
int OrExpr = 23;
int CoerceExpr = 24;
int LiteralExpr = 25;
int MatchBindExpr = 26;
int NounExpr = 27;
int ObjectExpr = 28;
int InterfaceExpr = 29;
int QuasiLiteralExpr = 30;
int QuasiPatternExpr = 31;
int MetaStateExpr = 32;
int MetaContextExpr = 33;
int SeqExpr = 34;
int SlotExpr = 35;
int MetaExpr = 36;
int CatchExpr = 37;
int FinallyExpr = 38;
int ReturnExpr = 39;
int ContinueExpr = 40;
int BreakExpr = 41;
int WhileExpr = 42;
int SwitchExpr = 43;
int TryExpr = 44;
int MapPattern = 45;
int LiteralPattern = 46;
int TupleExpr = 47;
int MapExpr = 48;
int BindPattern = 49;
int SendExpr = 50;
int CurryExpr = 51;
int FinalPattern = 52;
int VarPattern = 53;
int SlotPattern = 54;
int ListPattern = 55;
int CdrPattern = 56;
int IgnorePattern = 57;
int SuchThatPattern = 58;
int QuasiLiteralPattern = 59;
int QuasiPatternPattern = 60;
int URI = 61;
int URIStart = 62;
int URIGetter = 63;
int URIExpr = 64;
int LambdaExpr = 65;
int EScript = 66;
int EMethod = 67;
int EMatcher = 68;
int List = 69;
int WhenFn = 70;
int HEX = 71;
int OCTAL = 72;
int WS = 73;
int LINESEP = 74;
int SL_COMMENT = 75;
int DOC_COMMENT = 76;
int CHAR_LITERAL = 77;
int STRING = 78;
int ESC = 79;
int HEX_DIGIT = 80;
int IDENT = 81;
int INT = 82;
int POSINT = 83;
int FLOAT64 = 84;
int EXPONENT = 85;
// ";" = 86
int LITERAL_pragma = 87;
// "." = 88
int LITERAL_meta = 89;
int LITERAL_if = 90;
int LITERAL_else = 91;
int LITERAL_for = 92;
int LITERAL_in = 93;
// "=>" = 94
int LITERAL_accum = 95;
int LITERAL_while = 96;
// "{" = 97
int LITERAL__ = 98;
// "+" = 99
// "*" = 100
// "&" = 101
// "|" = 102
int LITERAL_when = 103;
// "->" = 104
int LITERAL_finally = 105;
// ":" = 106
int LITERAL_escape = 107;
int LITERAL_thunk = 108;
int LITERAL_fn = 109;
int LITERAL_switch = 110;
int LITERAL_try = 111;
int LITERAL_bind = 112;
int LITERAL_var = 113;
int LITERAL_def = 114;
// ":=" = 115
// "(" = 116
// "," = 117
// ")" = 118
int LITERAL_extends = 119;
int LITERAL_implements = 120;
int LITERAL_to = 121;
int LITERAL_method = 122;
int LITERAL_on = 123;
int LITERAL_match = 124;
int LITERAL_throws = 125;
int LITERAL_interface = 126;
int LITERAL_guards = 127;
// "=" = 128
// "//=" = 129
// "+=" = 130
// "-=" = 131
// "*=" = 132
// "/=" = 133
// "%=" = 134
// "%%=" = 135
// "**=" = 136
// ">>=" = 137
// "<<=" = 138
// "&=" = 139
// "^=" = 140
// "|=" = 141
int LITERAL_break = 142;
int LITERAL_continue = 143;
int LITERAL_return = 144;
// "^" = 145
// "||" = 146
// "&&" = 147
// "==" = 148
// "!=" = 149
// "&!" = 150
// "=~" = 151
// "!~" = 152
// "<" = 153
// "<=" = 154
// "<=>" = 155
// ">=" = 156
// ">" = 157
// ".." = 158
// "..!" = 159
// "<<" = 160
// ">>" = 161
// "-" = 162
// "/" = 163
// "//" = 164
// "%" = 165
// "%%" = 166
// "**" = 167
// "!" = 168
// "~" = 169
// "[" = 170
// "]" = 171
// "<-" = 172
// "::" = 173
int LITERAL_catch = 174;
// "?" = 175
// "${" = 176
// "$" = 177
// "$$" = 178
// "@{" = 179
// "@" = 180
int LITERAL_abstract = 181;
int LITERAL_an = 182;
int LITERAL_as = 183;
int LITERAL_assert = 184;
int LITERAL_attribute = 185;
int LITERAL_be = 186;
int LITERAL_begin = 187;
int LITERAL_behalf = 188;
int LITERAL_belief = 189;
int LITERAL_believe = 190;
int LITERAL_believes = 191;
int LITERAL_case = 192;
int LITERAL_class = 193;
int LITERAL_const = 194;
int LITERAL_constructor = 195;
int LITERAL_datatype = 196;
int LITERAL_declare = 197;
int LITERAL_default = 198;
int LITERAL_define = 199;
int LITERAL_defmacro = 200;
int LITERAL_delicate = 201;
int LITERAL_deprecated = 202;
int LITERAL_dispatch = 203;
int LITERAL_do = 204;
int LITERAL_encapsulate = 205;
int LITERAL_encapsulated = 206;
int LITERAL_encapsulates = 207;
int LITERAL_end = 208;
int LITERAL_ensure = 209;
int LITERAL_enum = 210;
int LITERAL_eventual = 211;
int LITERAL_eventually = 212;
int LITERAL_export = 213;
int LITERAL_facet = 214;
int LITERAL_forall = 215;
int LITERAL_fun = 216;
int LITERAL_function = 217;
int LITERAL_given = 218;
int LITERAL_hidden = 219;
int LITERAL_hides = 220;
int LITERAL_inline = 221;
int LITERAL_know = 222;
int LITERAL_knows = 223;
int LITERAL_lambda = 224;
int LITERAL_let = 225;
int LITERAL_methods = 226;
int LITERAL_namespace = 227;
int LITERAL_native = 228;
int LITERAL_obeys = 229;
int LITERAL_octet = 230;
int LITERAL_oneway = 231;
int LITERAL_operator = 232;
int LITERAL_package = 233;
int LITERAL_private = 234;
int LITERAL_protected = 235;
int LITERAL_public = 236;
int LITERAL_raises = 237;
int LITERAL_reliance = 238;
int LITERAL_reliant = 239;
int LITERAL_relies = 240;
int LITERAL_rely = 241;
int LITERAL_reveal = 242;
int LITERAL_sake = 243;
int LITERAL_signed = 244;
int LITERAL_static = 245;
int LITERAL_struct = 246;
int LITERAL_suchthat = 247;
int LITERAL_supports = 248;
int LITERAL_suspect = 249;
int LITERAL_suspects = 250;
int LITERAL_synchronized = 251;
int LITERAL_this = 252;
int LITERAL_transient = 253;
int LITERAL_truncatable = 254;
int LITERAL_typedef = 255;
int LITERAL_unsigned = 256;
int LITERAL_unum = 257;
int LITERAL_uses = 258;
int LITERAL_using = 259;
// "utf8" = 260
// "utf16" = 261
int LITERAL_virtual = 262;
int LITERAL_volatile = 263;
int LITERAL_wstring = 264;
int SR = 265;
int GE = 266;
int SR_ASSIGN = 267;
int LPAREN = 268;
int RPAREN = 269;
int LBRACK = 270;
int RBRACK = 271;
int LCURLY = 272;
int AT = 273;
int QUESTION = 274;
int COLON = 275;
int COMMA = 276;
int DOT = 277;
int THRU = 278;
int TILL = 279;
int SAME = 280;
int EQ = 281;
int LNOT = 282;
int BNOT = 283;
int NOTSAME = 284;
int DIV = 285;
int FLOORDIV = 286;
int PLUS = 287;
int MINUS = 288;
int INC = 289;
int DEC = 290;
int STAR = 291;
int REM = 292;
int MOD = 293;
int SL = 294;
int LE = 295;
int ABA = 296;
int BXOR = 297;
int BOR = 298;
int LOR = 299;
int BAND = 300;
int BUTNOT = 301;
int LAND = 302;
int SEMI = 303;
int POW = 304;
int ASSIGN = 305;
int FLOORDIV_ASSIGN = 306;
int DIV_ASSIGN = 307;
int PLUS_ASSIGN = 308;
int MINUS_ASSIGN = 309;
int STAR_ASSIGN = 310;
int REM_ASSIGN = 311;
int MOD_ASSIGN = 312;
int POW_ASSIGN = 313;
int SL_ASSIGN = 314;
int BXOR_ASSIGN = 315;
int BOR_ASSIGN = 316;
int BAND_ASSIGN = 317;
int SEND = 318;
int WHEN = 319;
int MAPSTO = 320;
int MATCHBIND = 321;
int MISMATCH = 322;
int SCOPE = 323;
int SCOPESLOT = 324;
int GT = 325;
int LT = 326;
int ESCWS = 327;
int ANYWS = 328;
int SKIPLINE = 329;
int UPDOC = 330;
int BR = 331;
int EOL = 332;
}
| 7,207 | 0.611905 | 0.486471 | 337 | 20.385757 | 6.167747 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.792285 | false | false | 7 |
14697aecdf5d0f5aecde85554e10b36312a04e83 | 38,697,655,353,606 | c92d8dfc793afaf54fb6f1f37b752c9ac859d141 | /cleancode/src/main/java/cleancode/ConstructionCost.java | f3771f30afb39ce12945247d5458b007cb1c6975 | [] | no_license | dimpy1234/DimpySenchoudhury_LoggingTask | https://github.com/dimpy1234/DimpySenchoudhury_LoggingTask | a448ba79eca5a895d61ef8e1927212e0ca07cbb0 | b5343368bf5b9b385e85c744f2cd49d2b674b98a | refs/heads/master | 2022-01-13T05:44:16.891000 | 2020-07-07T16:40:15 | 2020-07-07T16:40:15 | 243,306,039 | 0 | 1 | null | false | 2022-01-04T16:39:03 | 2020-02-26T16:09:30 | 2020-07-07T16:40:19 | 2022-01-04T16:39:03 | 12 | 0 | 0 | 4 | Java | false | false | package cleancode;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class ConstructionCost{
private static final Logger LOGGER= LogManager.getLogger(ConstructionCost.class);
private int material_standard_id;
private float house_area; //in square feet
private boolean is_fully_automated;
public ConstructionCost(){
int flag = 1;
Scanner sc = new Scanner(System.in);
//PrintStream obj = new PrintStream(new FileOutputStream(FileDescriptor.out));
do {
LOGGER.fatal("Press 1 for standard materials\n");
LOGGER.fatal("Press 2 for above standard materials\n");
LOGGER.fatal("Press 3 for high standard materials\n");
LOGGER.fatal("Enter your choice = ");
int choice = sc.nextInt();
switch (choice) {
case 1:
this.material_standard_id = 1;
LOGGER.fatal("The material standard selected is standard material\n");
flag = 0;
break;
case 2:
this.material_standard_id = 2;
LOGGER.fatal("The material standard selected is above standard material\n");
flag = 0;
break;
case 3:
this.material_standard_id = 3;
LOGGER.fatal("The material standard selected is high standard material\n");
flag = 0;
break;
default:
LOGGER.fatal("Wrong choice selected\n");
}
}while (flag==1);
LOGGER.fatal("Enter the house area = ");
this.house_area = sc.nextFloat();
LOGGER.fatal("Press y to get fully automated features = ");
sc.nextLine();
char ch = sc.next().charAt(0);
if(ch=='Y' ||ch=='y')
this.is_fully_automated = true;
else
this.is_fully_automated = false;
}
void calculate(){
float cost = 1;
PrintStream obj = new PrintStream(new FileOutputStream(FileDescriptor.out));
LOGGER.fatal("The calculated cost = ");
if(this.material_standard_id==1)
cost = 1200;
else if(this.material_standard_id==2)
cost = 1500;
else if(this.material_standard_id==3)
cost = 1800;
//automation cost calculated as 2500-1800=700
if(this.is_fully_automated)
cost += 700;
LOGGER.fatal(cost*this.house_area+"\n");
}
} | UTF-8 | Java | 2,699 | java | ConstructionCost.java | Java | [] | null | [] | package cleancode;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class ConstructionCost{
private static final Logger LOGGER= LogManager.getLogger(ConstructionCost.class);
private int material_standard_id;
private float house_area; //in square feet
private boolean is_fully_automated;
public ConstructionCost(){
int flag = 1;
Scanner sc = new Scanner(System.in);
//PrintStream obj = new PrintStream(new FileOutputStream(FileDescriptor.out));
do {
LOGGER.fatal("Press 1 for standard materials\n");
LOGGER.fatal("Press 2 for above standard materials\n");
LOGGER.fatal("Press 3 for high standard materials\n");
LOGGER.fatal("Enter your choice = ");
int choice = sc.nextInt();
switch (choice) {
case 1:
this.material_standard_id = 1;
LOGGER.fatal("The material standard selected is standard material\n");
flag = 0;
break;
case 2:
this.material_standard_id = 2;
LOGGER.fatal("The material standard selected is above standard material\n");
flag = 0;
break;
case 3:
this.material_standard_id = 3;
LOGGER.fatal("The material standard selected is high standard material\n");
flag = 0;
break;
default:
LOGGER.fatal("Wrong choice selected\n");
}
}while (flag==1);
LOGGER.fatal("Enter the house area = ");
this.house_area = sc.nextFloat();
LOGGER.fatal("Press y to get fully automated features = ");
sc.nextLine();
char ch = sc.next().charAt(0);
if(ch=='Y' ||ch=='y')
this.is_fully_automated = true;
else
this.is_fully_automated = false;
}
void calculate(){
float cost = 1;
PrintStream obj = new PrintStream(new FileOutputStream(FileDescriptor.out));
LOGGER.fatal("The calculated cost = ");
if(this.material_standard_id==1)
cost = 1200;
else if(this.material_standard_id==2)
cost = 1500;
else if(this.material_standard_id==3)
cost = 1800;
//automation cost calculated as 2500-1800=700
if(this.is_fully_automated)
cost += 700;
LOGGER.fatal(cost*this.house_area+"\n");
}
} | 2,699 | 0.562801 | 0.545387 | 69 | 38.130436 | 21.611801 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.753623 | false | false | 7 |
fa0da078e7afaa94e2e849b4538349e9a3fdaf69 | 25,692,494,415,478 | 2c3d865b48063d33e82f88ef7de879558383f5ec | /RESTful server/src/main/java/com/ibsystem/util/jsonWrapper/form/ContactForm.java | 74929bd1d1e4a6f9875219b469bc1633a596cbfb | [] | no_license | ragelo/IBSystem | https://github.com/ragelo/IBSystem | 325961f84a8215dfbefe5d7ecd42229aa782166a | b2773fb5e93ef388f383405f06d494012e93a83b | refs/heads/master | 2016-09-12T05:21:08.810000 | 2016-05-09T17:42:02 | 2016-05-09T17:42:02 | 54,234,539 | 2 | 1 | null | false | 2016-05-09T15:51:33 | 2016-03-18T22:13:25 | 2016-05-08T09:11:45 | 2016-05-09T15:51:33 | 808 | 2 | 0 | 0 | Java | null | null | package com.ibsystem.util.jsonWrapper.form;
public class ContactForm {
private String newFirstName;
private String newLastName;
private String newPatronymic;
private String newPassport;
private String newAddress;
private String newPhone;
private String newEmail;
public ContactForm() {}
public String getNewFirstName() {
return newFirstName;
}
public void setNewFirstName(String newFirstName) {
this.newFirstName = newFirstName;
}
public String getNewLastName() {
return newLastName;
}
public void setNewLastName(String newLastName) {
this.newLastName = newLastName;
}
public String getNewPatronymic() {
return newPatronymic;
}
public void setNewPatronymic(String newPatronymic) {
this.newPatronymic = newPatronymic;
}
public String getNewPassport() {
return newPassport;
}
public void setNewPassport(String newPassport) {
this.newPassport = newPassport;
}
public String getNewAddress() {
return newAddress;
}
public void setNewAddress(String newAddress) {
this.newAddress = newAddress;
}
public String getNewPhone() {
return newPhone;
}
public void setNewPhone(String newPhone) {
this.newPhone = newPhone;
}
public String getNewEmail() {
return newEmail;
}
public void setNewEmail(String newEmail) {
this.newEmail = newEmail;
}
@Override
public String toString() {
return "ContactForm{" +
"newFirstName='" + newFirstName + '\'' +
", newLastName='" + newLastName + '\'' +
", newPatronymic='" + newPatronymic + '\'' +
", newPassport='" + newPassport + '\'' +
", newAddress='" + newAddress + '\'' +
", newPhone='" + newPhone + '\'' +
", newEmail='" + newEmail + '\'' +
'}';
}
} | UTF-8 | Java | 1,996 | java | ContactForm.java | Java | [] | null | [] | package com.ibsystem.util.jsonWrapper.form;
public class ContactForm {
private String newFirstName;
private String newLastName;
private String newPatronymic;
private String newPassport;
private String newAddress;
private String newPhone;
private String newEmail;
public ContactForm() {}
public String getNewFirstName() {
return newFirstName;
}
public void setNewFirstName(String newFirstName) {
this.newFirstName = newFirstName;
}
public String getNewLastName() {
return newLastName;
}
public void setNewLastName(String newLastName) {
this.newLastName = newLastName;
}
public String getNewPatronymic() {
return newPatronymic;
}
public void setNewPatronymic(String newPatronymic) {
this.newPatronymic = newPatronymic;
}
public String getNewPassport() {
return newPassport;
}
public void setNewPassport(String newPassport) {
this.newPassport = newPassport;
}
public String getNewAddress() {
return newAddress;
}
public void setNewAddress(String newAddress) {
this.newAddress = newAddress;
}
public String getNewPhone() {
return newPhone;
}
public void setNewPhone(String newPhone) {
this.newPhone = newPhone;
}
public String getNewEmail() {
return newEmail;
}
public void setNewEmail(String newEmail) {
this.newEmail = newEmail;
}
@Override
public String toString() {
return "ContactForm{" +
"newFirstName='" + newFirstName + '\'' +
", newLastName='" + newLastName + '\'' +
", newPatronymic='" + newPatronymic + '\'' +
", newPassport='" + newPassport + '\'' +
", newAddress='" + newAddress + '\'' +
", newPhone='" + newPhone + '\'' +
", newEmail='" + newEmail + '\'' +
'}';
}
} | 1,996 | 0.589679 | 0.589679 | 82 | 23.353659 | 19.379 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.353659 | false | false | 7 |
c737490fb06a4b8bfc95547e0a2adb686401940b | 27,376,121,604,824 | a23c512227d6b947dd2998f5e930a587fe836953 | /RestaurantsReserver/src/ReservationApplication.java | 2426056e8fa5b21c6eb10a517cbe86744a8955e6 | [] | no_license | hsbacot/CSF_Homework | https://github.com/hsbacot/CSF_Homework | f258187727a69b902e84857e6b07cec569f31a9b | 7e8ff39067ead9e065d53b531bf15901c693bfe4 | refs/heads/master | 2020-12-11T04:20:29.160000 | 2014-02-19T23:31:45 | 2014-02-19T23:31:45 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Created by hsbacot on 12/16/13.
*/
import java.util.ArrayList;
import java.util.Scanner;
public class ReservationApplication {
public static void main(String[] args) {
boolean moreReservations = true;
boolean source = false;
ArrayList<Object> reservations = new ArrayList<Object>();
while (moreReservations) {
Scanner scanner = new Scanner(System.in);
System.out.println("Would you like to make a reservation? (Y/n)");
String again = scanner.next();
if (again == "n") {
moreReservations = false;
} else {
// Scanner scanner = new Scanner(System.in);
System.out.println("Would you like make your reservation by phone or online? (phone/online)");
String type = scanner.next();
if (type == "phone") {
source = true;
}
if (source) {
System.out.println("What time do you want to eat?");
int time = scanner.nextInt();
System.out.println("What is your name?");
String name = scanner.next();
System.out.println("How many people are in your party?");
int party = scanner.nextInt();
System.out.println("What phone number can we reach you at?");
String phone = scanner.next();
PhoneReservation reso = new PhoneReservation();
reso.setName(name);
reso.setParty(party);
reso.setTime(time);
reso.setPhoneNumber(phone);
reservations.add(reso);
} else {
System.out.println("What time do you want to eat?");
int time = scanner.nextInt();
System.out.println("What is your name?");
String name = scanner.next();
System.out.println("How many people are in your party?");
int party = scanner.nextInt();
System.out.println("What phone number can we reach you at?");
String phone = scanner.next();
System.out.println("What is the source address of the restaurant's website?");
String url = scanner.next();
WebReservation reso = new WebReservation();
reso.setName(name);
reso.setParty(party);
reso.setTime(time);
reso.setContactNumber(phone);
reso.setSourceWebsite(url);
reservations.add(reso);
}
System.out.println(reservations);
}
}
// Scanner scanner = new Scanner(System.in);
// System.out.println("What time do you want to eat?");
// int time = scanner.nextInt();
//
// System.out.println("What is your name?");
// String name = scanner.next();
//
// System.out.println("How many people are in your party?");
// int party = scanner.nextInt();
//
// Reservation reso = new Reservation();
// reso.setName(name);
// reso.setParty(party);
// reso.setTime(time);
//
// System.out.print(reso.getParty());
}
}
| UTF-8 | Java | 3,547 | java | ReservationApplication.java | Java | [
{
"context": "/**\n * Created by hsbacot on 12/16/13.\n */\nimport java.util.ArrayList;\nimpo",
"end": 25,
"score": 0.9996817708015442,
"start": 18,
"tag": "USERNAME",
"value": "hsbacot"
}
] | null | [] | /**
* Created by hsbacot on 12/16/13.
*/
import java.util.ArrayList;
import java.util.Scanner;
public class ReservationApplication {
public static void main(String[] args) {
boolean moreReservations = true;
boolean source = false;
ArrayList<Object> reservations = new ArrayList<Object>();
while (moreReservations) {
Scanner scanner = new Scanner(System.in);
System.out.println("Would you like to make a reservation? (Y/n)");
String again = scanner.next();
if (again == "n") {
moreReservations = false;
} else {
// Scanner scanner = new Scanner(System.in);
System.out.println("Would you like make your reservation by phone or online? (phone/online)");
String type = scanner.next();
if (type == "phone") {
source = true;
}
if (source) {
System.out.println("What time do you want to eat?");
int time = scanner.nextInt();
System.out.println("What is your name?");
String name = scanner.next();
System.out.println("How many people are in your party?");
int party = scanner.nextInt();
System.out.println("What phone number can we reach you at?");
String phone = scanner.next();
PhoneReservation reso = new PhoneReservation();
reso.setName(name);
reso.setParty(party);
reso.setTime(time);
reso.setPhoneNumber(phone);
reservations.add(reso);
} else {
System.out.println("What time do you want to eat?");
int time = scanner.nextInt();
System.out.println("What is your name?");
String name = scanner.next();
System.out.println("How many people are in your party?");
int party = scanner.nextInt();
System.out.println("What phone number can we reach you at?");
String phone = scanner.next();
System.out.println("What is the source address of the restaurant's website?");
String url = scanner.next();
WebReservation reso = new WebReservation();
reso.setName(name);
reso.setParty(party);
reso.setTime(time);
reso.setContactNumber(phone);
reso.setSourceWebsite(url);
reservations.add(reso);
}
System.out.println(reservations);
}
}
// Scanner scanner = new Scanner(System.in);
// System.out.println("What time do you want to eat?");
// int time = scanner.nextInt();
//
// System.out.println("What is your name?");
// String name = scanner.next();
//
// System.out.println("How many people are in your party?");
// int party = scanner.nextInt();
//
// Reservation reso = new Reservation();
// reso.setName(name);
// reso.setParty(party);
// reso.setTime(time);
//
// System.out.print(reso.getParty());
}
}
| 3,547 | 0.484071 | 0.482379 | 95 | 36.336842 | 27.046396 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 7 |
dc40b2bca35c13640b88b5aaec225999a1e7f0f1 | 27,376,121,605,219 | e5fb18465d43ce0e5ec0a94b7813959e28edf406 | /src/ch23/TestHeap.java | a6842811d89702432420bd0fbbbbeeba4d79c695 | [] | no_license | MahmoudMabrok/Introduction | https://github.com/MahmoudMabrok/Introduction | 98add3477c82cdecc8faf93aba37858af5dd8b01 | a85efaf4765c1758e06239e6770c3d7621b549be | refs/heads/master | 2021-01-20T03:56:27.416000 | 2018-03-06T05:36:04 | 2018-03-06T05:36:04 | 101,373,246 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ch23;
/**
* this is
* Created by mo3tamed on 2/5/18.
*/
public class TestHeap {
public static void main(String[] args) {
Heap<Integer> h = new Heap<>() ;
h.add(5);
h.add(1);
h.add(12);
h.add(9);
h.add(50);
System.out.println(h);
System.out.println(h.remove());
System.out.println(h);
System.out.println(h.remove());
System.out.println(h);
System.out.println("10".charAt(0));
}
}
| UTF-8 | Java | 499 | java | TestHeap.java | Java | [
{
"context": "package ch23;\n\n/**\n * this is\n * Created by mo3tamed on 2/5/18.\n */\npublic class TestHeap {\n\n publi",
"end": 52,
"score": 0.9996200203895569,
"start": 44,
"tag": "USERNAME",
"value": "mo3tamed"
}
] | null | [] | package ch23;
/**
* this is
* Created by mo3tamed on 2/5/18.
*/
public class TestHeap {
public static void main(String[] args) {
Heap<Integer> h = new Heap<>() ;
h.add(5);
h.add(1);
h.add(12);
h.add(9);
h.add(50);
System.out.println(h);
System.out.println(h.remove());
System.out.println(h);
System.out.println(h.remove());
System.out.println(h);
System.out.println("10".charAt(0));
}
}
| 499 | 0.51503 | 0.480962 | 26 | 18.192308 | 15.150576 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 7 |
f24a4dbae1348f3b5bb8bc97564adb8d00ed9dc7 | 37,366,215,510,439 | 5ee23f3ba8092d1ea1a3bc7b02c10a2abe373c44 | /app/src/main/java/com/netban/edc/wallet/module/trade/out/scan/ScanOutModel.java | 02d41063e7e0068bb42c77e33ce94388f0ce2614 | [] | no_license | jimshanghai/Gtoken-Android | https://github.com/jimshanghai/Gtoken-Android | 4a46669736fc863c9b09842fc1e69b26f0ceaef9 | 4067ed6dac7bbba386c11ae5fa76bef3cee15f48 | refs/heads/master | 2020-03-29T21:24:23.853000 | 2018-09-26T04:00:05 | 2018-09-26T04:00:05 | 150,364,984 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.netban.edc.wallet.module.trade.out.scan;
import com.netban.edc.wallet.api.NetClient;
import com.netban.edc.wallet.base.mvp.BaseModel;
import com.netban.edc.wallet.bean.RequestBean;
import com.netban.edc.wallet.bean.ToUser;
import com.netban.edc.wallet.bean.TradeOutBean;
import com.netban.edc.wallet.module.trade.out.TradeOutContract;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Created by Evan on 2018/8/13.
*/
public class ScanOutModel extends BaseModel implements ScanOutContract.Model {
private ToUser.DataBean touser;
@Override
public Observable<RequestBean<TradeOutBean.DataBean>> isTransferAccounts(double val, String numbers, String contract) {
return NetClient.getInstance().getNetApi().isTransferAccounts(getAuthorization(),val,numbers,contract,"").subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
}
@Override
public Observable<RequestBean<ToUser.DataBean>> getUserInfo(String numbers) {
return NetClient.getInstance().getNetApi().getUserInfo(getAuthorization(),numbers).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
}
public ToUser.DataBean getTouser() {
return touser;
}
public void setTouser(ToUser.DataBean touser) {
this.touser = touser;
}
}
| UTF-8 | Java | 1,382 | java | ScanOutModel.java | Java | [
{
"context": "mport rx.schedulers.Schedulers;\n\n/**\n * Created by Evan on 2018/8/13.\n */\n\npublic class ScanOutModel exte",
"end": 475,
"score": 0.9973562359809875,
"start": 471,
"tag": "NAME",
"value": "Evan"
}
] | null | [] | package com.netban.edc.wallet.module.trade.out.scan;
import com.netban.edc.wallet.api.NetClient;
import com.netban.edc.wallet.base.mvp.BaseModel;
import com.netban.edc.wallet.bean.RequestBean;
import com.netban.edc.wallet.bean.ToUser;
import com.netban.edc.wallet.bean.TradeOutBean;
import com.netban.edc.wallet.module.trade.out.TradeOutContract;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Created by Evan on 2018/8/13.
*/
public class ScanOutModel extends BaseModel implements ScanOutContract.Model {
private ToUser.DataBean touser;
@Override
public Observable<RequestBean<TradeOutBean.DataBean>> isTransferAccounts(double val, String numbers, String contract) {
return NetClient.getInstance().getNetApi().isTransferAccounts(getAuthorization(),val,numbers,contract,"").subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
}
@Override
public Observable<RequestBean<ToUser.DataBean>> getUserInfo(String numbers) {
return NetClient.getInstance().getNetApi().getUserInfo(getAuthorization(),numbers).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());
}
public ToUser.DataBean getTouser() {
return touser;
}
public void setTouser(ToUser.DataBean touser) {
this.touser = touser;
}
}
| 1,382 | 0.765557 | 0.760492 | 37 | 36.351353 | 44.431675 | 192 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.594595 | false | false | 7 |
cc2073b78b3e3e160aacff254b96903f62edca3e | 30,013,231,524,760 | e93f2e00af159a3481efa4f323fa111002490e3f | /src/main/java/tn/esprit/spring/Models/Participants.java | 44a39ab30247d40a71196dcbc339760c3da70cf9 | [] | no_license | Mayssa-bit/KINDERGARTEN | https://github.com/Mayssa-bit/KINDERGARTEN | 92fdfcc73a8e60b228ec722367b80272a8811ac2 | c89f0323fd4b1c64ea15c46c332bbe092b29491f | refs/heads/master | 2022-07-06T12:36:46.792000 | 2020-05-06T14:09:36 | 2020-05-06T14:09:36 | 245,135,979 | 0 | 0 | null | false | 2022-06-21T03:13:35 | 2020-03-05T10:41:55 | 2020-05-06T14:08:06 | 2022-06-21T03:13:34 | 719 | 0 | 0 | 7 | Java | false | false | package tn.esprit.spring.Models;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name="T_PARTICIPANT")
public class Participants implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="ID_PARTICIP")
long idParticip;
@Column(name="NOM_PARTICIP")
String nomParticip;
@Column(name="NOM_EVENT")
String nomEvent;
public String getNomEvent() {
return nomEvent;
}
public void setNomEvent(String nomEvent) {
this.nomEvent = nomEvent;
}
@ManyToMany(cascade = CascadeType.ALL)
private Set<Evenements> evenements;
public long getIdParticip() {
return idParticip;
}
public void setIdParticip(long idParticip) {
this.idParticip = idParticip;
}
public String getNomParticip() {
return nomParticip;
}
public void setNomParticip(String nomParticip) {
this.nomParticip = nomParticip;
}
public Set<Evenements> getEvenements() {
return evenements;
}
public void setEvenements(Set<Evenements> evenements) {
this.evenements = evenements;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "Participants [idParticip=" + idParticip + ", nomParticip=" + nomParticip + ", nomEvent=" + nomEvent
+ ", evenements=" + evenements + "]";
}
public Participants(long idParticip, String nomParticip, String nomEvent, Set<Evenements> evenements) {
super();
this.idParticip = idParticip;
this.nomParticip = nomParticip;
this.nomEvent = nomEvent;
this.evenements = evenements;
}
public Participants() {
super();
// TODO Auto-generated constructor stub
}
} | UTF-8 | Java | 2,070 | java | Participants.java | Java | [] | null | [] | package tn.esprit.spring.Models;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name="T_PARTICIPANT")
public class Participants implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="ID_PARTICIP")
long idParticip;
@Column(name="NOM_PARTICIP")
String nomParticip;
@Column(name="NOM_EVENT")
String nomEvent;
public String getNomEvent() {
return nomEvent;
}
public void setNomEvent(String nomEvent) {
this.nomEvent = nomEvent;
}
@ManyToMany(cascade = CascadeType.ALL)
private Set<Evenements> evenements;
public long getIdParticip() {
return idParticip;
}
public void setIdParticip(long idParticip) {
this.idParticip = idParticip;
}
public String getNomParticip() {
return nomParticip;
}
public void setNomParticip(String nomParticip) {
this.nomParticip = nomParticip;
}
public Set<Evenements> getEvenements() {
return evenements;
}
public void setEvenements(Set<Evenements> evenements) {
this.evenements = evenements;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "Participants [idParticip=" + idParticip + ", nomParticip=" + nomParticip + ", nomEvent=" + nomEvent
+ ", evenements=" + evenements + "]";
}
public Participants(long idParticip, String nomParticip, String nomEvent, Set<Evenements> evenements) {
super();
this.idParticip = idParticip;
this.nomParticip = nomParticip;
this.nomEvent = nomEvent;
this.evenements = evenements;
}
public Participants() {
super();
// TODO Auto-generated constructor stub
}
} | 2,070 | 0.713043 | 0.71256 | 94 | 20.042553 | 21.078331 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.265957 | false | false | 7 |
36869169685af1eecb9b3989e4adb8d0c5d98321 | 34,282,429,010,215 | 5a1bf4b9c7e8b6977c293f0d459d1749a64fe955 | /src/main/java/com/sltas/jibx/v3/Voucher.java | a83305a2aaa00bb69fb03c96f493aa2f1f835522 | [] | no_license | zhangjianfeng1994/rabbit_test | https://github.com/zhangjianfeng1994/rabbit_test | d7e25ef41cdda4d0e6482edc4a00149892e344d1 | db3c883d3b584bcf1cb206011c42ad3ea4f0eb16 | refs/heads/master | 2022-12-20T10:45:27.597000 | 2019-10-18T10:32:53 | 2019-10-18T10:32:53 | 215,996,401 | 1 | 0 | null | false | 2022-12-16T04:45:26 | 2019-10-18T10:09:51 | 2022-06-21T08:34:37 | 2022-12-16T04:45:23 | 384 | 0 | 0 | 17 | Java | false | false | package com.sltas.jibx.v3;
import lombok.Data;
@Data
public class Voucher {
private String id;
private VoucherHead voucher_head;
private VoucherBody voucher_body;
}
| UTF-8 | Java | 174 | java | Voucher.java | Java | [] | null | [] | package com.sltas.jibx.v3;
import lombok.Data;
@Data
public class Voucher {
private String id;
private VoucherHead voucher_head;
private VoucherBody voucher_body;
}
| 174 | 0.758621 | 0.752874 | 13 | 12.384615 | 13.088682 | 34 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false | 7 |
8bc2f55891a931eddc7935d038b5775d0163626b | 34,282,429,011,755 | c18330f540df6e85190d0fb4aa1c16d0326b7b5e | /src/main/java/ua/lviv/lgs/dao/OrderDao.java | fea87716eb4523d9aa5753a8e606f7ade08db393 | [] | no_license | ahromov/i-shop | https://github.com/ahromov/i-shop | 3ca873eaf32e14b8f9bb27c7e8d19c0abc1dfdde | 22068c432c71ab30ade24bd1ceabd01efe3730f1 | refs/heads/master | 2022-11-04T06:14:57.878000 | 2020-10-13T12:02:10 | 2020-10-21T20:43:29 | 171,147,265 | 0 | 0 | null | false | 2022-10-05T19:21:07 | 2019-02-17T16:55:37 | 2020-10-21T20:43:34 | 2022-10-05T19:21:04 | 27,520 | 0 | 0 | 3 | Java | false | false | package ua.lviv.lgs.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import ua.lviv.lgs.dao.manager.FactoryManager;
import ua.lviv.lgs.domain.Order;
import ua.lviv.lgs.service.dao.AI.AbstractCRUD;
public class OrderDao implements AbstractCRUD<Order> {
private static final Logger log = LogManager.getLogger(OrderDao.class);
private static final EntityManager em = FactoryManager.getEntityManager();
private static OrderDao orderDao;
private OrderDao() {
}
public static OrderDao getOrderDao() {
if (orderDao == null) {
orderDao = new OrderDao();
}
return orderDao;
}
@Override
public Order create(Order order) {
try {
em.getTransaction().begin();
em.persist(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t create " + order.getId(), e);
em.getTransaction().rollback();
}
return order;
}
@Override
public Order getById(String id) {
Order order = null;
try {
order = em.find(Order.class, id);
} catch (Exception e) {
log.error("Can`t read " + order.getId(), e);
}
return order;
}
@Override
public Order update(Order order) {
try {
em.getTransaction().begin();
em.merge(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t update " + order.getId(), e);
em.getTransaction().rollback();
}
return order;
}
@Override
public void delete(Order order) {
try {
em.getTransaction().begin();
em.remove(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t delete " + order.getId(), e);
em.getTransaction().rollback();
}
}
@SuppressWarnings("unchecked")
@Override
public List<Order> readAll() {
Query query = null;
try {
query = em.createQuery("SELECT e FROM Order e");
} catch (Exception e) {
log.error("Can`t read all ", e);
}
return (List<Order>) query.getResultList();
}
}
| UTF-8 | Java | 2,033 | java | OrderDao.java | Java | [] | null | [] | package ua.lviv.lgs.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import ua.lviv.lgs.dao.manager.FactoryManager;
import ua.lviv.lgs.domain.Order;
import ua.lviv.lgs.service.dao.AI.AbstractCRUD;
public class OrderDao implements AbstractCRUD<Order> {
private static final Logger log = LogManager.getLogger(OrderDao.class);
private static final EntityManager em = FactoryManager.getEntityManager();
private static OrderDao orderDao;
private OrderDao() {
}
public static OrderDao getOrderDao() {
if (orderDao == null) {
orderDao = new OrderDao();
}
return orderDao;
}
@Override
public Order create(Order order) {
try {
em.getTransaction().begin();
em.persist(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t create " + order.getId(), e);
em.getTransaction().rollback();
}
return order;
}
@Override
public Order getById(String id) {
Order order = null;
try {
order = em.find(Order.class, id);
} catch (Exception e) {
log.error("Can`t read " + order.getId(), e);
}
return order;
}
@Override
public Order update(Order order) {
try {
em.getTransaction().begin();
em.merge(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t update " + order.getId(), e);
em.getTransaction().rollback();
}
return order;
}
@Override
public void delete(Order order) {
try {
em.getTransaction().begin();
em.remove(order);
em.getTransaction().commit();
} catch (Exception e) {
log.error("Can`t delete " + order.getId(), e);
em.getTransaction().rollback();
}
}
@SuppressWarnings("unchecked")
@Override
public List<Order> readAll() {
Query query = null;
try {
query = em.createQuery("SELECT e FROM Order e");
} catch (Exception e) {
log.error("Can`t read all ", e);
}
return (List<Order>) query.getResultList();
}
}
| 2,033 | 0.674865 | 0.673881 | 101 | 19.128714 | 18.161903 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.742574 | false | false | 7 |
a14d4375d1fdafa0f221c5ae7373a9fde613ceb7 | 36,902,359,044,833 | 87b65381dafc51a4f6ba115bed06578c34323b4e | /GamePanel.java | eb2666c8ae5a5a49a02e44d23ccc8271c73d749c | [] | no_license | alextat120/HungryDragon | https://github.com/alextat120/HungryDragon | 07f5102ce137014b61e7d099729631d362c647ea | 3ecc059778832b2426c606d4d972465a06a485b4 | refs/heads/master | 2021-01-20T21:23:26.503000 | 2015-09-10T05:35:14 | 2015-09-10T05:35:14 | 42,224,073 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Scanner;
import javax.swing.JFrame;
import java.util.ArrayList;
import java.awt.event.KeyListener;
public class GamePanel extends JPanel implements ActionListener, KeyListener
{
public final int NORTH=0, SOUTH=180,EAST=90, WEST=270;
public int direction;
Timer t= new Timer(100, this);
//public int time;
Snake s = new Snake();
public final int LENGTH=s.getLength();
public final int HEIGHT=s.getHeight();
String str = "IM HUNGRY!!!! Help me to my food by using the ARROW KEYS";
public int BALLSIZE = s.getBallSize();
public int score =0;
public int temp =0;
public GamePanel()
{
this.addKeyListener(this);
}
public void paintComponent(Graphics g)
{
if(score<30){
s.setInvincible(false);
}
else
s.setInvincible(true);
super.paintComponent(g);
this.setBackground(Color.BLACK);
g.setColor(Color.WHITE);
if(isGameOver()){
System.out.println("Coordinates of Head: " + s.getX(0) + "," +s.getY(0));
str = str.replace(str, "GAME OVER - Score: " + score);
g.setColor(Color.RED);
g.setFont(new Font("Courier", Font.BOLD, 30));
g.drawString(str, (LENGTH/2)-(str.length()*10),HEIGHT/2 );
}
else{
System.out.println("Coordinates of Head: " + s.getX(0) + "," +s.getY(0));
this.setBackground(Color.BLACK);
g.setColor(Color.WHITE);
g.drawLine(0,HEIGHT,LENGTH,HEIGHT);
g.drawLine(LENGTH,HEIGHT,LENGTH,0);
g.setColor(Color.GREEN);
g.drawString(str, 400 ,500);
paintFood(g);
paintRocks(g);
/*
if(score>4){
paintPower(g);
}
*/
System.out.println("Painted food");
if (s.hasEaten()==true){
score+=1;
str=str.replace(str, "Yum! CHICKEN pcs: " + score);
s.add(s.size()-1, s.food);
}
/*
if(s.poweredUp()){
s.setInvincible(true);
}
*/
for(int z=0;z<s.size();z++)
{
JPanel p = new JPanel();
ImageIcon i = new ImageIcon("firstdragon.png");
g.setColor(Color.BLUE);
if(z==0){
g.setColor(Color.CYAN);
//g.fillOval(s.getX(z),s.getY(z),BALLSIZE,BALLSIZE);
g.drawImage(i.getImage(), s.getX(z), s.getY(z), BALLSIZE, BALLSIZE,null);
}
else
//g.drawOval(s.getX(z),s.getY(z),BALLSIZE,BALLSIZE);
{
ImageIcon body = new ImageIcon("body.png");
g.drawImage(body.getImage(),s.getX(z),s.getY(z),BALLSIZE,BALLSIZE,null);
}
}
}
}
/*
public void paintPower(Graphics g){
ImageIcon i = new ImageIcon("human.png");
g.drawImage(i.getImage(), s.px,s.py, BALLSIZE, BALLSIZE,null);
}
*/
public void paintFood(Graphics g){
//super.paintComponent(g);
//g.setColor(Color.WHITE);
//g.drawRect(0,0,900,500);
ImageIcon i = new ImageIcon("food.png");
g.setColor(Color.RED);
System.out.println("a is" + s.a);
System.out.println("b is" + s.b);
g.drawImage(i.getImage(), s.a, s.b, BALLSIZE, BALLSIZE,null);
//g.fillOval(s.a,s.b, BALLSIZE,BALLSIZE);
}
public void paintRocks(Graphics g){
ImageIcon i = new ImageIcon("bomb.png");
for (int x = 0; x<s.rocks.size()-1;x++){
g.drawImage(i.getImage(), s.rocks.get(x).getX(),s.rocks.get(x).getY(), BALLSIZE, BALLSIZE, null);
}
}
public boolean isGameOver(){
if(s.inBounds()==false || s.isAlive()==false){
return true;
}
return false;
}
public void actionPerformed(ActionEvent e){
if(s.inBounds()){
{
if (direction == NORTH)
{
System.out.println("CHANGED coordinates - NORTH");
s.add(0, new Point(s.getX(0),s.getY(0)-BALLSIZE));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == SOUTH)
{
System.out.println("CHANGED coordinates - SOUTH");
s.add(0, new Point(s.getX(0),s.getY(0)+BALLSIZE));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == EAST)
{
System.out.println("CHANGED coordinates - EAST");
s.add(0, new Point(s.getX(0)+BALLSIZE,s.getY(0)));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == WEST)
{
System.out.println("CHANGED coordinates - WEST");
s.add(0, new Point(s.getX(0)-BALLSIZE,s.getY(0)));
//repaint();
s.remove(s.size()-1);
repaint();
}
}
System.out.println("HAS REpainted");
}
else{
str = str.replace(str, "GAME OVER");
repaint();
}
}
public void keyTyped(KeyEvent e) {
}
public void keyReleased(KeyEvent e){
}
public void keyPressed(KeyEvent e){
t.start();
if(temp==0){
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
temp=-1;
}
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
temp=-1;
}
else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
temp=-1;
}
else /*(e.getKeyCode() == KeyEvent.VK_UP)*/ {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
temp=-1;
}
}
if(direction == WEST){
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
else if (e.getKeyCode() == KeyEvent.VK_UP) {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
else //if (e.getKeyCode() == KeyEvent.VK_RIGHT)
{
System.out.println("direction is " + direction);
direction=WEST;
}
}
else if(direction ==EAST){
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
else if (e.getKeyCode() == KeyEvent.VK_UP) {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
else// if (e.getKeyCode() == KeyEvent.VK_LEFT)
{
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
}
else if(direction ==NORTH){
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
}
else //(e.getKeyCode() == KeyEvent.VK_DOWN)
{
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
}
else if(direction==SOUTH){
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
}
else// (e.getKeyCode() == KeyEvent.VK_UP)
{
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
}
}
}
class Snake {
int ate=0;
ArrayList<Point> snake = new ArrayList<Point>();
ArrayList<Point> rocks = new ArrayList<Point>();
//ArrayList<Point> temp = new ArrayList<Point>();
boolean alive =true;
final int BALLSIZE = 30;
final int LENGTH=BALLSIZE*30;
final int HEIGHT =BALLSIZE*16;
int a =(int)(Math.random()*LENGTH);
int b = (int)(Math.random()*HEIGHT);
int rx =(int)(Math.random()*LENGTH);
int ry = (int)(Math.random()*HEIGHT);
//int px;
//int py;
Point food;
public Snake()
{
//snake.add(new Point(0,10));
snake.add(new Point(0,BALLSIZE));
//snake.add(new Point(0,30));
snake.add(new Point(0,BALLSIZE*2));
//snake.add(new Point(0,50));
snake.add(new Point(0,BALLSIZE*3));
//snake.add(new Point(0,70));
snake.add(new Point(0,BALLSIZE*4));
while(a%BALLSIZE != 0){
a =(int)(Math.random()*LENGTH);
}
while(b%BALLSIZE !=0){
b =(int)(Math.random()*HEIGHT);
}
while((rx%BALLSIZE != 0) || (Math.abs(rx-a)<(BALLSIZE*3))) {
rx =(int)(Math.random()*LENGTH);
}
while((ry%BALLSIZE !=0) ||(Math.abs(ry-b)<(BALLSIZE*3))){
ry =(int)(Math.random()*HEIGHT);
}
food = new Point(a,b);
rocks.add(new Point(rx,ry));
}
public int getHeight(){
return HEIGHT;
}
public int getLength(){
return LENGTH;
}
public int getBallSize(){
return BALLSIZE;
}
public int size(){
return snake.size();
}
public int getX(int x){
return snake.get(x).getX();
}
public int getY(int y){
return snake.get(y).getY();
}
public void add(int z, Point p){
snake.add(z,p);
}
public void remove(int r){
snake.remove(r);
}
public boolean inBounds(){
if (this.getX(0)<LENGTH && this.getX(0)>=0 && this.getY(0)>=0 && this.getY(0)<HEIGHT){
return true;
}
else
return false;
}
public boolean hasEaten(){
/*
ate++;
if(ate==5){
px = (int)(Math.random()*LENGTH);
py = (int)(Math.random()*LENGTH);
}
*/
if(this.getX(0) == a && this.getY(0)== b)
{
a =(int)(Math.random()*LENGTH);
b = (int)(Math.random()*HEIGHT);
rx=(int)(Math.random()*LENGTH);
ry =(int)(Math.random()*LENGTH);
//a == rx and ry only checks for the one being created, need to check previous ones with ArrayList rocks
// make a temporary arraylist to store the points
// go through array looking to see if there exists the same rx or ry that equals a or b.
/*for(int x =0;x<rocks.size();x++){
temp.add(rocks.get(x));
}
*/
while(a%BALLSIZE != 0 || a==rx) {
a =(int)(Math.random()*LENGTH);
}
while(b%BALLSIZE !=0 || b==ry){
b =(int)(Math.random()*HEIGHT);
}
while((rx%BALLSIZE != 0) || ( Math.abs(rx-a)<(BALLSIZE*3))){
rx =(int)(Math.random()*LENGTH);
}
while((ry%BALLSIZE != 0) || (Math.abs(rx-a)<(BALLSIZE*3))){
ry =(int)(Math.random()*HEIGHT);
}
rocks.add(new Point(rx,ry));
if (rocks.size()>7){
rocks.remove(0);
}
food = new Point (a,b);
return true;
}
else
return false;
}
public void setInvincible(boolean b){
if(b == true){/*
for(int x = 1; x <snake.size();x++){
if (this.getX(0) == this.getX(x) && this.getY(0) == this.getY(x)){
alive=true;
}
}
for(int x=0;x<rocks.size();x++){
if(this.getX(0)==rocks.get(x).getX() && this.getY(0) == rocks.get(x).getY()){
alive = true;
}
}
*/
}
if(b==false){
for(int x = 1; x <snake.size();x++){
if (this.getX(0) == this.getX(x) && this.getY(0) == this.getY(x)){
alive=false;
}
}
for(int x=0;x<rocks.size();x++){
if(this.getX(0)==rocks.get(x).getX() && this.getY(0) == rocks.get(x).getY()){
alive = false;
}
}
}
}
public boolean isAlive(){
return alive;
}
/*
public boolean poweredUp(){
if(px == this.getX(0) && py == this.getY(0)){
return true;
}
else
return false;
}
*/
public static void main(String[] args)
{
JFrame window = new JFrame("DRAGON TRAIL");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//int x=100;
GamePanel panel = new GamePanel();
panel.setFocusable(true);
window.add(panel);
window.setSize(900+20,500+50);
window.setLocationRelativeTo(null);
window.setResizable(true);
if (panel.isGameOver()){
JFrame over = new JFrame("YOU DIED...");
over.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel p = new JPanel();
JButton b = new JButton("RETRY");
p.add(b);
over.add(p);
over.setVisible(true);
}
window.setVisible(true);
/*
while(true){
if(panel.score<10){
x = 100;
}
else if(panel.score<20){
x=80;
}
else if(panel.score<30){
x=60;
}
else{
x=50;
}
}
*/
}
}
| UTF-8 | Java | 14,408 | java | GamePanel.java | Java | [] | null | [] | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Scanner;
import javax.swing.JFrame;
import java.util.ArrayList;
import java.awt.event.KeyListener;
public class GamePanel extends JPanel implements ActionListener, KeyListener
{
public final int NORTH=0, SOUTH=180,EAST=90, WEST=270;
public int direction;
Timer t= new Timer(100, this);
//public int time;
Snake s = new Snake();
public final int LENGTH=s.getLength();
public final int HEIGHT=s.getHeight();
String str = "IM HUNGRY!!!! Help me to my food by using the ARROW KEYS";
public int BALLSIZE = s.getBallSize();
public int score =0;
public int temp =0;
public GamePanel()
{
this.addKeyListener(this);
}
public void paintComponent(Graphics g)
{
if(score<30){
s.setInvincible(false);
}
else
s.setInvincible(true);
super.paintComponent(g);
this.setBackground(Color.BLACK);
g.setColor(Color.WHITE);
if(isGameOver()){
System.out.println("Coordinates of Head: " + s.getX(0) + "," +s.getY(0));
str = str.replace(str, "GAME OVER - Score: " + score);
g.setColor(Color.RED);
g.setFont(new Font("Courier", Font.BOLD, 30));
g.drawString(str, (LENGTH/2)-(str.length()*10),HEIGHT/2 );
}
else{
System.out.println("Coordinates of Head: " + s.getX(0) + "," +s.getY(0));
this.setBackground(Color.BLACK);
g.setColor(Color.WHITE);
g.drawLine(0,HEIGHT,LENGTH,HEIGHT);
g.drawLine(LENGTH,HEIGHT,LENGTH,0);
g.setColor(Color.GREEN);
g.drawString(str, 400 ,500);
paintFood(g);
paintRocks(g);
/*
if(score>4){
paintPower(g);
}
*/
System.out.println("Painted food");
if (s.hasEaten()==true){
score+=1;
str=str.replace(str, "Yum! CHICKEN pcs: " + score);
s.add(s.size()-1, s.food);
}
/*
if(s.poweredUp()){
s.setInvincible(true);
}
*/
for(int z=0;z<s.size();z++)
{
JPanel p = new JPanel();
ImageIcon i = new ImageIcon("firstdragon.png");
g.setColor(Color.BLUE);
if(z==0){
g.setColor(Color.CYAN);
//g.fillOval(s.getX(z),s.getY(z),BALLSIZE,BALLSIZE);
g.drawImage(i.getImage(), s.getX(z), s.getY(z), BALLSIZE, BALLSIZE,null);
}
else
//g.drawOval(s.getX(z),s.getY(z),BALLSIZE,BALLSIZE);
{
ImageIcon body = new ImageIcon("body.png");
g.drawImage(body.getImage(),s.getX(z),s.getY(z),BALLSIZE,BALLSIZE,null);
}
}
}
}
/*
public void paintPower(Graphics g){
ImageIcon i = new ImageIcon("human.png");
g.drawImage(i.getImage(), s.px,s.py, BALLSIZE, BALLSIZE,null);
}
*/
public void paintFood(Graphics g){
//super.paintComponent(g);
//g.setColor(Color.WHITE);
//g.drawRect(0,0,900,500);
ImageIcon i = new ImageIcon("food.png");
g.setColor(Color.RED);
System.out.println("a is" + s.a);
System.out.println("b is" + s.b);
g.drawImage(i.getImage(), s.a, s.b, BALLSIZE, BALLSIZE,null);
//g.fillOval(s.a,s.b, BALLSIZE,BALLSIZE);
}
public void paintRocks(Graphics g){
ImageIcon i = new ImageIcon("bomb.png");
for (int x = 0; x<s.rocks.size()-1;x++){
g.drawImage(i.getImage(), s.rocks.get(x).getX(),s.rocks.get(x).getY(), BALLSIZE, BALLSIZE, null);
}
}
public boolean isGameOver(){
if(s.inBounds()==false || s.isAlive()==false){
return true;
}
return false;
}
public void actionPerformed(ActionEvent e){
if(s.inBounds()){
{
if (direction == NORTH)
{
System.out.println("CHANGED coordinates - NORTH");
s.add(0, new Point(s.getX(0),s.getY(0)-BALLSIZE));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == SOUTH)
{
System.out.println("CHANGED coordinates - SOUTH");
s.add(0, new Point(s.getX(0),s.getY(0)+BALLSIZE));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == EAST)
{
System.out.println("CHANGED coordinates - EAST");
s.add(0, new Point(s.getX(0)+BALLSIZE,s.getY(0)));
//repaint();
s.remove(s.size()-1);
repaint();
}
else if (direction == WEST)
{
System.out.println("CHANGED coordinates - WEST");
s.add(0, new Point(s.getX(0)-BALLSIZE,s.getY(0)));
//repaint();
s.remove(s.size()-1);
repaint();
}
}
System.out.println("HAS REpainted");
}
else{
str = str.replace(str, "GAME OVER");
repaint();
}
}
public void keyTyped(KeyEvent e) {
}
public void keyReleased(KeyEvent e){
}
public void keyPressed(KeyEvent e){
t.start();
if(temp==0){
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
temp=-1;
}
else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
temp=-1;
}
else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
temp=-1;
}
else /*(e.getKeyCode() == KeyEvent.VK_UP)*/ {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
temp=-1;
}
}
if(direction == WEST){
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
else if (e.getKeyCode() == KeyEvent.VK_UP) {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
else //if (e.getKeyCode() == KeyEvent.VK_RIGHT)
{
System.out.println("direction is " + direction);
direction=WEST;
}
}
else if(direction ==EAST){
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
else if (e.getKeyCode() == KeyEvent.VK_UP) {
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
else// if (e.getKeyCode() == KeyEvent.VK_LEFT)
{
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
}
else if(direction ==NORTH){
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
}
else //(e.getKeyCode() == KeyEvent.VK_DOWN)
{
//System.out.println("A KEY WAS PRESSED.");
direction=NORTH;
}
}
else if(direction==SOUTH){
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
//System.out.println("A KEY WAS PRESSED.");
direction=EAST;
}
else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
//System.out.println("A KEY WAS PRESSED.");
direction=WEST;
}
else// (e.getKeyCode() == KeyEvent.VK_UP)
{
//System.out.println("A KEY WAS PRESSED.");
direction=SOUTH;
}
}
}
}
class Snake {
int ate=0;
ArrayList<Point> snake = new ArrayList<Point>();
ArrayList<Point> rocks = new ArrayList<Point>();
//ArrayList<Point> temp = new ArrayList<Point>();
boolean alive =true;
final int BALLSIZE = 30;
final int LENGTH=BALLSIZE*30;
final int HEIGHT =BALLSIZE*16;
int a =(int)(Math.random()*LENGTH);
int b = (int)(Math.random()*HEIGHT);
int rx =(int)(Math.random()*LENGTH);
int ry = (int)(Math.random()*HEIGHT);
//int px;
//int py;
Point food;
public Snake()
{
//snake.add(new Point(0,10));
snake.add(new Point(0,BALLSIZE));
//snake.add(new Point(0,30));
snake.add(new Point(0,BALLSIZE*2));
//snake.add(new Point(0,50));
snake.add(new Point(0,BALLSIZE*3));
//snake.add(new Point(0,70));
snake.add(new Point(0,BALLSIZE*4));
while(a%BALLSIZE != 0){
a =(int)(Math.random()*LENGTH);
}
while(b%BALLSIZE !=0){
b =(int)(Math.random()*HEIGHT);
}
while((rx%BALLSIZE != 0) || (Math.abs(rx-a)<(BALLSIZE*3))) {
rx =(int)(Math.random()*LENGTH);
}
while((ry%BALLSIZE !=0) ||(Math.abs(ry-b)<(BALLSIZE*3))){
ry =(int)(Math.random()*HEIGHT);
}
food = new Point(a,b);
rocks.add(new Point(rx,ry));
}
public int getHeight(){
return HEIGHT;
}
public int getLength(){
return LENGTH;
}
public int getBallSize(){
return BALLSIZE;
}
public int size(){
return snake.size();
}
public int getX(int x){
return snake.get(x).getX();
}
public int getY(int y){
return snake.get(y).getY();
}
public void add(int z, Point p){
snake.add(z,p);
}
public void remove(int r){
snake.remove(r);
}
public boolean inBounds(){
if (this.getX(0)<LENGTH && this.getX(0)>=0 && this.getY(0)>=0 && this.getY(0)<HEIGHT){
return true;
}
else
return false;
}
public boolean hasEaten(){
/*
ate++;
if(ate==5){
px = (int)(Math.random()*LENGTH);
py = (int)(Math.random()*LENGTH);
}
*/
if(this.getX(0) == a && this.getY(0)== b)
{
a =(int)(Math.random()*LENGTH);
b = (int)(Math.random()*HEIGHT);
rx=(int)(Math.random()*LENGTH);
ry =(int)(Math.random()*LENGTH);
//a == rx and ry only checks for the one being created, need to check previous ones with ArrayList rocks
// make a temporary arraylist to store the points
// go through array looking to see if there exists the same rx or ry that equals a or b.
/*for(int x =0;x<rocks.size();x++){
temp.add(rocks.get(x));
}
*/
while(a%BALLSIZE != 0 || a==rx) {
a =(int)(Math.random()*LENGTH);
}
while(b%BALLSIZE !=0 || b==ry){
b =(int)(Math.random()*HEIGHT);
}
while((rx%BALLSIZE != 0) || ( Math.abs(rx-a)<(BALLSIZE*3))){
rx =(int)(Math.random()*LENGTH);
}
while((ry%BALLSIZE != 0) || (Math.abs(rx-a)<(BALLSIZE*3))){
ry =(int)(Math.random()*HEIGHT);
}
rocks.add(new Point(rx,ry));
if (rocks.size()>7){
rocks.remove(0);
}
food = new Point (a,b);
return true;
}
else
return false;
}
public void setInvincible(boolean b){
if(b == true){/*
for(int x = 1; x <snake.size();x++){
if (this.getX(0) == this.getX(x) && this.getY(0) == this.getY(x)){
alive=true;
}
}
for(int x=0;x<rocks.size();x++){
if(this.getX(0)==rocks.get(x).getX() && this.getY(0) == rocks.get(x).getY()){
alive = true;
}
}
*/
}
if(b==false){
for(int x = 1; x <snake.size();x++){
if (this.getX(0) == this.getX(x) && this.getY(0) == this.getY(x)){
alive=false;
}
}
for(int x=0;x<rocks.size();x++){
if(this.getX(0)==rocks.get(x).getX() && this.getY(0) == rocks.get(x).getY()){
alive = false;
}
}
}
}
public boolean isAlive(){
return alive;
}
/*
public boolean poweredUp(){
if(px == this.getX(0) && py == this.getY(0)){
return true;
}
else
return false;
}
*/
public static void main(String[] args)
{
JFrame window = new JFrame("DRAGON TRAIL");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//int x=100;
GamePanel panel = new GamePanel();
panel.setFocusable(true);
window.add(panel);
window.setSize(900+20,500+50);
window.setLocationRelativeTo(null);
window.setResizable(true);
if (panel.isGameOver()){
JFrame over = new JFrame("YOU DIED...");
over.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel p = new JPanel();
JButton b = new JButton("RETRY");
p.add(b);
over.add(p);
over.setVisible(true);
}
window.setVisible(true);
/*
while(true){
if(panel.score<10){
x = 100;
}
else if(panel.score<20){
x=80;
}
else if(panel.score<30){
x=60;
}
else{
x=50;
}
}
*/
}
}
| 14,408 | 0.466546 | 0.455303 | 549 | 25.24408 | 20.310041 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.590164 | false | false | 7 |
e5cda0569b95bdbf5ff0586d56b675fa07653fca | 38,336,878,116,909 | c6f48a74c88b4f8365c6392863a13616afc7fdbd | /BLM104_2018_2019_Bahar/src/Ders09/Ornek2.java | 1f8b317af1b12a28dbb55ac75248b0aba3764882 | [] | no_license | alinizam/BLM104_2018_2019_Bahar | https://github.com/alinizam/BLM104_2018_2019_Bahar | fee8a307019d212dd1c5838cefb996cc305aca40 | 71a0094d40866ceab14fc6d8140e1c8348c2f0ae | refs/heads/master | 2020-04-22T14:33:32.137000 | 2019-05-16T07:41:39 | 2019-05-16T07:41:39 | 170,447,768 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Ders09;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author alinizam
*/
public class Ornek2 {
public static void main(String[] args) {
try {
int malzeme_id=10;
String adi="Ataç",turu="Kıstasiye";
Connection con=DriverManager.getConnection("jdbc:derby://localhost:1527/sample", "app", "app");
String sql="INSERT INTO malzeme (malzeme_id,adi,turu) VALUES (?,?,?)";
PreparedStatement st=con.prepareStatement(sql);
st.setInt(1, malzeme_id);
st.setString(2, adi);
st.setString(3, turu);
int i=st.executeUpdate();
System.out.println(i+" adet kayıt girildi.");
} catch (SQLException ex) {
Logger.getLogger(Ders08.Ornek2.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| UTF-8 | Java | 1,278 | java | Ornek2.java | Java | [
{
"context": "t java.util.logging.Logger;\r\n\r\n/**\r\n *\r\n * @author alinizam\r\n */\r\npublic class Ornek2 {\r\n public static void",
"end": 462,
"score": 0.9941220283508301,
"start": 454,
"tag": "USERNAME",
"value": "alinizam"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Ders09;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author alinizam
*/
public class Ornek2 {
public static void main(String[] args) {
try {
int malzeme_id=10;
String adi="Ataç",turu="Kıstasiye";
Connection con=DriverManager.getConnection("jdbc:derby://localhost:1527/sample", "app", "app");
String sql="INSERT INTO malzeme (malzeme_id,adi,turu) VALUES (?,?,?)";
PreparedStatement st=con.prepareStatement(sql);
st.setInt(1, malzeme_id);
st.setString(2, adi);
st.setString(3, turu);
int i=st.executeUpdate();
System.out.println(i+" adet kayıt girildi.");
} catch (SQLException ex) {
Logger.getLogger(Ders08.Ornek2.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| 1,278 | 0.607059 | 0.595294 | 40 | 29.875 | 26.013638 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.85 | false | false | 7 |
101d8e272e736ca110085d8ef65d041b845a23c0 | 3,582,002,791,047 | 8d0bc32aa04c53df139894fea0fa315e8cf1a562 | /src/main/java/kr/ac/hansung/cse/domain/ProductDto.java | 33d072f0e4728edaeb1edaf5441a45063831d6ec | [] | no_license | qlqhtlrrl4/smallEstore | https://github.com/qlqhtlrrl4/smallEstore | 6c51cf3bb456a308ae2883111e942f8fdb5feace | 8f54e29545688f961aabb1c97e62d1e62b100b23 | refs/heads/main | 2023-08-14T00:26:44.799000 | 2021-10-05T00:58:02 | 2021-10-05T00:58:02 | 395,173,779 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.ac.hansung.cse.domain;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ProductDto {
private String name;
private String category;
private int price;
private String manufacture;
private int unitInStock;
private String description;
}
| UTF-8 | Java | 294 | java | ProductDto.java | Java | [] | null | [] | package kr.ac.hansung.cse.domain;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ProductDto {
private String name;
private String category;
private int price;
private String manufacture;
private int unitInStock;
private String description;
}
| 294 | 0.741497 | 0.741497 | 24 | 11.25 | 11.70203 | 33 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 7 |
4dfe4f9932c4b5709ff7d43450db93087a6d2aa2 | 15,101,105,079,886 | f2dd8342c0bf6258442c6c60c08318549ae99fab | /src/com/syntax/class08/Homework.java | 7013b4ddfed93781df3c17d980428efe23553d49 | [] | no_license | mariiayarema/SeleniumClasses | https://github.com/mariiayarema/SeleniumClasses | fd1fa7138fe62acb2e4122a66e8f06b88480a534 | ebcac5334caf566534c5c3847fc1537fe5b699d7 | refs/heads/main | 2023-04-26T10:09:34.955000 | 2021-05-20T21:47:16 | 2021-05-20T21:47:16 | 331,500,471 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.syntax.class08;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.concurrent.TimeUnit;
public class Homework {
public static String url = "https://the-internet.herokuapp.com/dynamic_controls";
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver");
WebDriver driver = new ChromeDriver();
driver.navigate().to(url);
WebDriverWait wait=new WebDriverWait(driver,10);
WebElement checkBox=driver.findElement(By.xpath("//input[@type='checkbox']"));
checkBox.click();
WebElement remove=driver.findElement(By.xpath("//button[text()='Remove']"));
remove.click();
WebElement afterRemovalElement=driver.findElement(By.id("message"));
wait.until(ExpectedConditions.visibilityOf(afterRemovalElement));
String textAfterRemove=afterRemovalElement.getText();
System.out.println(textAfterRemove);
WebDriverWait wait1=new WebDriverWait(driver,10);
WebElement enableButton=driver.findElement(By.xpath("//button[@onclick='swapInput()']"));
Thread.sleep(2000);
enableButton.click();
WebElement afterEnable=driver.findElement(By.xpath("//p[@id='message']"));
wait1.until(ExpectedConditions.visibilityOf(afterEnable));
WebElement enterTextElement=driver.findElement(By.xpath("//input[@type='text']"));
enterTextElement.isEnabled();
enterTextElement.sendKeys("Syntax Technologies");
WebElement disableButton=driver.findElement(By.xpath("//button[@onclick='swapInput()']"));
disableButton.click();
enterTextElement.isEnabled();
}
}
| UTF-8 | Java | 1,950 | java | Homework.java | Java | [] | null | [] | package com.syntax.class08;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.util.concurrent.TimeUnit;
public class Homework {
public static String url = "https://the-internet.herokuapp.com/dynamic_controls";
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver");
WebDriver driver = new ChromeDriver();
driver.navigate().to(url);
WebDriverWait wait=new WebDriverWait(driver,10);
WebElement checkBox=driver.findElement(By.xpath("//input[@type='checkbox']"));
checkBox.click();
WebElement remove=driver.findElement(By.xpath("//button[text()='Remove']"));
remove.click();
WebElement afterRemovalElement=driver.findElement(By.id("message"));
wait.until(ExpectedConditions.visibilityOf(afterRemovalElement));
String textAfterRemove=afterRemovalElement.getText();
System.out.println(textAfterRemove);
WebDriverWait wait1=new WebDriverWait(driver,10);
WebElement enableButton=driver.findElement(By.xpath("//button[@onclick='swapInput()']"));
Thread.sleep(2000);
enableButton.click();
WebElement afterEnable=driver.findElement(By.xpath("//p[@id='message']"));
wait1.until(ExpectedConditions.visibilityOf(afterEnable));
WebElement enterTextElement=driver.findElement(By.xpath("//input[@type='text']"));
enterTextElement.isEnabled();
enterTextElement.sendKeys("Syntax Technologies");
WebElement disableButton=driver.findElement(By.xpath("//button[@onclick='swapInput()']"));
disableButton.click();
enterTextElement.isEnabled();
}
}
| 1,950 | 0.712308 | 0.706154 | 46 | 41.391304 | 30.534 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.782609 | false | false | 7 |
4ba14c9265430cb684a859638d7e82dab32885b9 | 37,873,021,638,861 | b57b244956c08a7fda44484b72805b6b9a9d8598 | /Excercise JIRA/src/main/java/controllers/DashboardController.java | aa9740d749184cb8016b2247c678f54832501bac | [] | no_license | YuriMutsu/AngularJS | https://github.com/YuriMutsu/AngularJS | 5e1e4144887dba13ba47d269f920267947f9c0eb | 7c7b7006f5dd54aac5e51d81a1c713aaa9bc46b6 | refs/heads/master | 2021-05-23T06:02:15.322000 | 2019-06-22T02:18:01 | 2019-06-22T02:18:01 | 94,753,569 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package controllers;
import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import models.gadget.Gadget;
import ninja.Result;
import ninja.Results;
import ninja.params.Param;
import ninja.params.SessionParam;
import ninja.session.Session;
import org.apache.log4j.Logger;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.json.JSONArray;
import org.json.JSONObject;
import util.Constant;
import util.PropertiesUtil;
import java.util.List;
import static service.GadgetService.getDashboardGadgetbyDashboardId;
import static util.Constant.*;
import static util.MyUtil.isAdmin;
/**
* Created by tmtai on 7/17/2017.
*/
public class DashboardController {
public final static Logger logger = Logger.getLogger(DashboardController.class);
public Result getDashboardInfo(@Param("id") String id) {
if (id == null) {
return Results.noContent();
}
JSONObject info = new JSONObject();
List<Gadget> dashboardGadgets;
try {
dashboardGadgets = getDashboardGadgetbyDashboardId(id);
info.put(GADGET, dashboardGadgets.size());
int sonarGadget = 0;
int reviewGadget = 0;
for (Gadget gadget : dashboardGadgets) {
Gadget.Type type = gadget.getType();
if (Gadget.Type.AMS_SONAR_STATISTICS_GADGET.equals(type)) {
sonarGadget++;
} else if (Gadget.Type.AMS_OVERDUE_REVIEWS.equals(type)) {
reviewGadget++;
}
}
//todo
info.put(Constant.SONAR_GADGET, sonarGadget);
info.put(Constant.REVIEW_GADGET, reviewGadget);
} catch (Exception e) {
logger.error("getDashboardInfo ", e);
return Results.internalServerError();
}
return Results.text().render(info);
}
public Result getDashboardList(@Param("groups") String groups, @Param("projects") String projects, Session session) {
try {
JSONArray userGroup = new JSONArray(groups);
JSONArray userProject = new JSONArray(projects);
List<Object> groupsNprojects = userGroup.toList();
groupsNprojects.addAll(userProject.toList());
JSONArray dashboardList = new JSONArray();
MongoClient mongoClient = new MongoClient();
MongoCollection<Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
FindIterable<Document> iterable = collection.find();
iterable.forEach(new Block<Document>() {
@Override
public void apply(final Document document) {
try {
JSONObject dashboard = new JSONObject();
String owner = document.getString(Constant.OWNER);
JSONObject privacy = new JSONObject(document.getString(Constant.PRIVACY));
Boolean contain = false;
try {
List<Object> share = privacy.getJSONArray(Constant.SHARE_OPTION).toList();
for (Object o : share) {
if (groupsNprojects.contains(o)) {
contain = true;
break;
}
}
} catch (Exception e) {
logger.warn(e);
}
if (!isAdmin(session)) {
if (contain || owner.equals(session.get(USERNAME)) || privacy.getString(PRIVACY_STATUS).equals(PRIVACY_STATUS_PUBLIC)) {
dashboard.put("id", document.getObjectId(Constant.MONGODB_ID).toHexString());
dashboard.put(Constant.OWNER, owner);
dashboard.put(NAME, document.get(DASHBOARD_NAME_COL));
dashboard.put(Constant.PRIVACY, privacy);
dashboardList.put(dashboard);
}
} else {
dashboard.put("id", document.getObjectId(Constant.MONGODB_ID).toHexString());
dashboard.put(Constant.OWNER, owner);
dashboard.put(NAME, document.get(DASHBOARD_NAME_COL));
dashboard.put(Constant.PRIVACY, privacy);
dashboardList.put(dashboard);
}
} catch (Exception exception) {
logger.error("error when getDashboardList()", exception);
}
}
});
logger.info("DASHBOARDS " + dashboardList);
mongoClient.close();
return Results.text().render(dashboardList);
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result new_dashboard() {
return Results.html();
}
public Result new_dashboard_post(@SessionParam("username") String username,
@Param("name") String name) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
JSONObject privacy = new JSONObject();
privacy.put(PRIVACY_STATUS, PRIVACY_STATUS_PRIVATE);
privacy.put(SHARE_OPTION, new JSONArray());
collection.insertOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId()).append(Constant.OWNER, username).append(DASHBOARD_NAME_COL, name).append(Constant.PRIVACY, privacy.toString()));
mongoClient.close();
return Results.redirect("/");
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result updateDashboardOption(@Param("id") String dashboardId, @Param("name") String dashboardName, @Param("privacy") String privacy) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
org.bson.Document doc = new org.bson.Document(DASHBOARD_NAME_COL, dashboardName).append(Constant.PRIVACY, privacy);
collection.updateOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)), new org.bson.Document(Constant.MONGODB_SET, doc));
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result deleteDashboard(@Param("id") String dashboardId, Session session) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
Document document = collection.find(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId))).first();
if (isAdmin(session)) {
collection.deleteOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)));
mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION).deleteMany(new org.bson.Document(Constant.DASHBOARD_ID, dashboardId));
} else {
if (document.getString(Constant.OWNER).equals(session.get(USERNAME))) {
collection.deleteOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)));
mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION).deleteMany(new org.bson.Document(Constant.DASHBOARD_ID, dashboardId));
}
}
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result deleteAllDashboard() {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
collection.drop();
MongoCollection<org.bson.Document> gadgetCollection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION);
gadgetCollection.drop();
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
}
| UTF-8 | Java | 9,310 | java | DashboardController.java | Java | [
{
"context": "ort static util.MyUtil.isAdmin;\n\n/**\n * Created by tmtai on 7/17/2017.\n */\npublic class DashboardControlle",
"end": 705,
"score": 0.9996144771575928,
"start": 700,
"tag": "USERNAME",
"value": "tmtai"
},
{
"context": " if (contain || owner.equals(session.ge... | null | [] | package controllers;
import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import models.gadget.Gadget;
import ninja.Result;
import ninja.Results;
import ninja.params.Param;
import ninja.params.SessionParam;
import ninja.session.Session;
import org.apache.log4j.Logger;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.json.JSONArray;
import org.json.JSONObject;
import util.Constant;
import util.PropertiesUtil;
import java.util.List;
import static service.GadgetService.getDashboardGadgetbyDashboardId;
import static util.Constant.*;
import static util.MyUtil.isAdmin;
/**
* Created by tmtai on 7/17/2017.
*/
public class DashboardController {
public final static Logger logger = Logger.getLogger(DashboardController.class);
public Result getDashboardInfo(@Param("id") String id) {
if (id == null) {
return Results.noContent();
}
JSONObject info = new JSONObject();
List<Gadget> dashboardGadgets;
try {
dashboardGadgets = getDashboardGadgetbyDashboardId(id);
info.put(GADGET, dashboardGadgets.size());
int sonarGadget = 0;
int reviewGadget = 0;
for (Gadget gadget : dashboardGadgets) {
Gadget.Type type = gadget.getType();
if (Gadget.Type.AMS_SONAR_STATISTICS_GADGET.equals(type)) {
sonarGadget++;
} else if (Gadget.Type.AMS_OVERDUE_REVIEWS.equals(type)) {
reviewGadget++;
}
}
//todo
info.put(Constant.SONAR_GADGET, sonarGadget);
info.put(Constant.REVIEW_GADGET, reviewGadget);
} catch (Exception e) {
logger.error("getDashboardInfo ", e);
return Results.internalServerError();
}
return Results.text().render(info);
}
public Result getDashboardList(@Param("groups") String groups, @Param("projects") String projects, Session session) {
try {
JSONArray userGroup = new JSONArray(groups);
JSONArray userProject = new JSONArray(projects);
List<Object> groupsNprojects = userGroup.toList();
groupsNprojects.addAll(userProject.toList());
JSONArray dashboardList = new JSONArray();
MongoClient mongoClient = new MongoClient();
MongoCollection<Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
FindIterable<Document> iterable = collection.find();
iterable.forEach(new Block<Document>() {
@Override
public void apply(final Document document) {
try {
JSONObject dashboard = new JSONObject();
String owner = document.getString(Constant.OWNER);
JSONObject privacy = new JSONObject(document.getString(Constant.PRIVACY));
Boolean contain = false;
try {
List<Object> share = privacy.getJSONArray(Constant.SHARE_OPTION).toList();
for (Object o : share) {
if (groupsNprojects.contains(o)) {
contain = true;
break;
}
}
} catch (Exception e) {
logger.warn(e);
}
if (!isAdmin(session)) {
if (contain || owner.equals(session.get(USERNAME)) || privacy.getString(PRIVACY_STATUS).equals(PRIVACY_STATUS_PUBLIC)) {
dashboard.put("id", document.getObjectId(Constant.MONGODB_ID).toHexString());
dashboard.put(Constant.OWNER, owner);
dashboard.put(NAME, document.get(DASHBOARD_NAME_COL));
dashboard.put(Constant.PRIVACY, privacy);
dashboardList.put(dashboard);
}
} else {
dashboard.put("id", document.getObjectId(Constant.MONGODB_ID).toHexString());
dashboard.put(Constant.OWNER, owner);
dashboard.put(NAME, document.get(DASHBOARD_NAME_COL));
dashboard.put(Constant.PRIVACY, privacy);
dashboardList.put(dashboard);
}
} catch (Exception exception) {
logger.error("error when getDashboardList()", exception);
}
}
});
logger.info("DASHBOARDS " + dashboardList);
mongoClient.close();
return Results.text().render(dashboardList);
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result new_dashboard() {
return Results.html();
}
public Result new_dashboard_post(@SessionParam("username") String username,
@Param("name") String name) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
JSONObject privacy = new JSONObject();
privacy.put(PRIVACY_STATUS, PRIVACY_STATUS_PRIVATE);
privacy.put(SHARE_OPTION, new JSONArray());
collection.insertOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId()).append(Constant.OWNER, username).append(DASHBOARD_NAME_COL, name).append(Constant.PRIVACY, privacy.toString()));
mongoClient.close();
return Results.redirect("/");
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result updateDashboardOption(@Param("id") String dashboardId, @Param("name") String dashboardName, @Param("privacy") String privacy) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
org.bson.Document doc = new org.bson.Document(DASHBOARD_NAME_COL, dashboardName).append(Constant.PRIVACY, privacy);
collection.updateOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)), new org.bson.Document(Constant.MONGODB_SET, doc));
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result deleteDashboard(@Param("id") String dashboardId, Session session) {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
Document document = collection.find(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId))).first();
if (isAdmin(session)) {
collection.deleteOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)));
mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION).deleteMany(new org.bson.Document(Constant.DASHBOARD_ID, dashboardId));
} else {
if (document.getString(Constant.OWNER).equals(session.get(USERNAME))) {
collection.deleteOne(new org.bson.Document(Constant.MONGODB_ID, new ObjectId(dashboardId)));
mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION).deleteMany(new org.bson.Document(Constant.DASHBOARD_ID, dashboardId));
}
}
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
public Result deleteAllDashboard() {
try {
MongoClient mongoClient = new MongoClient();
MongoCollection<org.bson.Document> collection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_TABLE);
collection.drop();
MongoCollection<org.bson.Document> gadgetCollection = mongoClient.getDatabase(PropertiesUtil.getString(Constant.DATABASE_SCHEMA)).getCollection(DASHBOARD_GADGET_COLECCTION);
gadgetCollection.drop();
mongoClient.close();
return Results.ok();
} catch (Exception e) {
logger.error(e);
return Results.internalServerError();
}
}
}
| 9,310 | 0.594307 | 0.593233 | 226 | 40.194691 | 42.374302 | 209 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.659292 | false | false | 7 |
fb4442aeb7495cefbb5656976fe8bc7e7303004f | 14,121,852,538,177 | 65925dd3e2e46edd95ecfd5f56287b2af8ac5a12 | /Java Web/源码-郭克华_JavaEE程序设计与应用开发/ch02/Prj02/src/Select1.java | 41716660e6c2d1c76bc44c65ad9f844da501572a | [] | no_license | GreenHatHG/tmp | https://github.com/GreenHatHG/tmp | d866abb9ab4f934199321bc5e59edf7c94210d00 | 5d5baea3e8e9c034cf42c0080d632a9080572bc3 | refs/heads/master | 2020-04-08T04:02:31.116000 | 2018-12-04T06:42:25 | 2018-12-04T06:42:25 | 159,000,135 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Select1 {
public static void main(String[] args) throws Exception{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:DSSchool");
Statement stat = conn.createStatement();
String sql =
"SELECT STUNO,STUNAME FROM T_STUDENT WHERE STUSEX='Ů'";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
String stuno = rs.getString("STUNO");
String stuname = rs.getString("STUNAME");
System.out.println(stuno + " " + stuname);
}
stat.close();
conn.close();
}
}
| UTF-8 | Java | 688 | java | Select1.java | Java | [] | null | [] | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Select1 {
public static void main(String[] args) throws Exception{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:DSSchool");
Statement stat = conn.createStatement();
String sql =
"SELECT STUNO,STUNAME FROM T_STUDENT WHERE STUSEX='Ů'";
ResultSet rs = stat.executeQuery(sql);
while(rs.next()){
String stuno = rs.getString("STUNO");
String stuname = rs.getString("STUNAME");
System.out.println(stuno + " " + stuname);
}
stat.close();
conn.close();
}
}
| 688 | 0.694323 | 0.692868 | 22 | 29.227272 | 19.324812 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false | 7 |
68606bc96af4cc35228ec803afe5f7b8e4970352 | 26,302,379,780,097 | c33ed30cf351450e27904705a2fdf694a86ac287 | /springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api/app163/exception/NoResultException.java | b051533bc605a0b2bd67858a956e3a37d948e5d7 | [
"Apache-2.0"
] | permissive | springdoc/springdoc-openapi | https://github.com/springdoc/springdoc-openapi | fb627bd976a1f464914402bdee00b492f6194a49 | d4f99ac9036a00ade542c3ebb1ce7780a171d7d8 | refs/heads/main | 2023-08-20T22:07:34.367000 | 2023-08-16T18:43:24 | 2023-08-16T18:43:24 | 196,475,719 | 2,866 | 503 | Apache-2.0 | false | 2023-09-11T19:37:09 | 2019-07-11T23:08:20 | 2023-09-11T19:18:24 | 2023-09-11T19:37:09 | 8,147 | 2,777 | 417 | 28 | Java | false | false | package test.org.springdoc.api.app163.exception;
public class NoResultException extends RuntimeException {
}
| UTF-8 | Java | 110 | java | NoResultException.java | Java | [] | null | [] | package test.org.springdoc.api.app163.exception;
public class NoResultException extends RuntimeException {
}
| 110 | 0.836364 | 0.809091 | 4 | 26.5 | 26.196373 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 7 |
6b5051751378269d0d9e4e97d9542bad837f7822 | 867,583,450,816 | 73c4a8cba6d74e98c6cc3b6efff6e6e3f171b986 | /src/main/java/pe/com/dipper/pdfupload/controllers/UploadPdfController.java | 03acab110a2e35bec958b5c6719c575bdff717d8 | [] | no_license | Eisten1996/pdf-upload | https://github.com/Eisten1996/pdf-upload | a5ee4c7e0e86a0952c8b28155bdd8c6f3f5eac1c | 7f6b8f737aa5dcdb69cab4feeb4c208b8d5a7972 | refs/heads/main | 2023-08-29T01:08:03.129000 | 2021-11-05T04:29:50 | 2021-11-05T04:29:50 | 402,153,512 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pe.com.dipper.pdfupload.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pe.com.dipper.pdfupload.message.ResponseMessage;
import pe.com.dipper.pdfupload.models.services.IUploadFileService;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.UUID;
/**
* @author Dipper
* @project pdf-upload
* @created 19/11/2020 - 15:46
*/
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RestController
@RequestMapping("/api")
public class UploadPdfController {
@Autowired
private IUploadFileService uploadFileService;
@GetMapping(value = "/output/{filename:.+}")
public ResponseEntity<Resource> verArchivo(@PathVariable String filename) {
Resource recurso = null;
try {
recurso = uploadFileService.load(filename);
} catch (MalformedURLException e) {
e.printStackTrace();
}
return ResponseEntity.status(HttpStatus.OK).body(recurso);
}
@RequestMapping(value = "/form", method = RequestMethod.POST)
public ResponseEntity<ResponseMessage> guardar(@RequestParam("file") MultipartFile pdf, @RequestParam("page") String page) {
Integer pag = Integer.parseInt(page);
String message = "";
String uniqueFilename = null;
try {
String uuid = UUID.randomUUID().toString();
uniqueFilename = uploadFileService.copy(pdf, uuid);
System.out.println(uniqueFilename);
message = "Uploaded the file successfully: " + pdf.getOriginalFilename();
uploadFileService.convertPdfToImage("uploads\\" + uniqueFilename, "jpg", pag, uuid);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseMessage(message, uuid));
} catch (IOException e) {
message = "Could not upload the file: " + pdf.getOriginalFilename() + "!";
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body(new ResponseMessage(message));
}
}
}
| UTF-8 | Java | 2,249 | java | UploadPdfController.java | Java | [
{
"context": "LException;\nimport java.util.UUID;\n\n/**\n * @author Dipper\n * @project pdf-upload\n * @created 19/11/2020 - 1",
"end": 588,
"score": 0.9539371132850647,
"start": 582,
"tag": "NAME",
"value": "Dipper"
}
] | null | [] | package pe.com.dipper.pdfupload.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pe.com.dipper.pdfupload.message.ResponseMessage;
import pe.com.dipper.pdfupload.models.services.IUploadFileService;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.UUID;
/**
* @author Dipper
* @project pdf-upload
* @created 19/11/2020 - 15:46
*/
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RestController
@RequestMapping("/api")
public class UploadPdfController {
@Autowired
private IUploadFileService uploadFileService;
@GetMapping(value = "/output/{filename:.+}")
public ResponseEntity<Resource> verArchivo(@PathVariable String filename) {
Resource recurso = null;
try {
recurso = uploadFileService.load(filename);
} catch (MalformedURLException e) {
e.printStackTrace();
}
return ResponseEntity.status(HttpStatus.OK).body(recurso);
}
@RequestMapping(value = "/form", method = RequestMethod.POST)
public ResponseEntity<ResponseMessage> guardar(@RequestParam("file") MultipartFile pdf, @RequestParam("page") String page) {
Integer pag = Integer.parseInt(page);
String message = "";
String uniqueFilename = null;
try {
String uuid = UUID.randomUUID().toString();
uniqueFilename = uploadFileService.copy(pdf, uuid);
System.out.println(uniqueFilename);
message = "Uploaded the file successfully: " + pdf.getOriginalFilename();
uploadFileService.convertPdfToImage("uploads\\" + uniqueFilename, "jpg", pag, uuid);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseMessage(message, uuid));
} catch (IOException e) {
message = "Could not upload the file: " + pdf.getOriginalFilename() + "!";
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body(new ResponseMessage(message));
}
}
}
| 2,249 | 0.700756 | 0.69542 | 56 | 39.160713 | 29.912239 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.642857 | false | false | 7 |
306715924205c931d6999ca2bcaa8b49e9cecb50 | 39,419,209,842,865 | 394fcfe7a3ac5f18ffed15e6ac09b0c86dc13d9c | /jwt/src/main/java/com/ntga/jwt/VioQzcsActivity.java | a0a56e9ef5cef13fe739111fd8e1df01e98a7fe8 | [] | no_license | lixd17820/ntgajwt | https://github.com/lixd17820/ntgajwt | 5a1eda06f0140da28c093f36d7e1971f0c615d7e | d0aa0502f69705515de85426d24187c2a92c403e | refs/heads/master | 2021-01-20T06:34:15.494000 | 2017-05-04T00:04:03 | 2017-05-04T00:04:03 | 89,894,863 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ntga.jwt;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.Map.Entry;
import java.util.TreeMap;
import com.ntga.bean.JdsPrintBean;
import com.ntga.bean.KeyValueBean;
import com.ntga.bean.VioViolation;
import com.ntga.bean.WfdmBean;
import com.ntga.dao.GlobalConstant;
import com.ntga.dao.GlobalData;
import com.ntga.dao.GlobalMethod;
import com.ntga.dao.PrintJdsTools;
import com.ntga.dao.VerifyData;
import com.ntga.dao.ViolationDAO;
import com.ntga.dao.WsglDAO;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class VioQzcsActivity extends ViolationActivity {
private static final String TAG = "VioQzcsActivity";
private Context self;
private ContentResolver resolver;
private EditText edAllWfxw;
private Button btnAddWfxwList;
private TreeMap<Integer, Boolean> qzcsMap = new TreeMap<Integer, Boolean>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
resolver = this.getContentResolver();
self = this;
edAllWfxw = (EditText) findViewById(R.id.Edit_wfxw_all);
btnAddWfxwList = (Button) findViewById(R.id.But_add_wfxw_list);
jdsbh = WsglDAO.getCurrentJdsbh(GlobalConstant.QZCSPZ, zqmj, resolver);
if (jdsbh == null) {
GlobalMethod.showDialogWithListener("提示信息",
"没有相应的处罚编号,请到文书管理中获取编号", "确定", exitSystem, self);
return;
}
if (WsglDAO.hmNotEqDw(jdsbh)) {
GlobalMethod.showDialogWithListener("提示信息",
"当前文书编号与处罚机关不符,请上交文书后重新获取", "确定", exitSystem, self);
return;
}
// 设置标题
setTitle(getActivityTitle());
textJdsbh.setText("强制措施编号:" + jdsbh.getDqhm());
initViolation();
// violation.setCfzl("2");
wslb = "3";
violation.setWslb(wslb);
violation.setFkje("0");
RelativeLayout r2 = (RelativeLayout) findViewById(R.id.layout_jycx);
r2.removeAllViewsInLayout();
registerForContextMenu(edAllWfxw);
btnAddWfxwList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addWfdmIntoEditWfxw();
}
});
}
@Override
protected String getViolationTitle() {
return "强制措施";
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.force_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (R.id.qzcsxm): {
showQzcsxmDialog();
}
return true;
case (R.id.save_quite):
return menuSaveViolation();
case (R.id.print_preview):
// 预览打印
return menuPreviewViolation();
case (R.id.pre_print):
// 单据已保存,打印决定书
return menuPrintViolation();
case R.id.con_vio:
if (violation != null && isViolationSaved)
showConVio(violation);
else
GlobalMethod.showToast("请保存当前决定书", self);
return true;
case R.id.sys_config:
Intent intent = new Intent(self, ConfigParamSetting.class);
startActivity(intent);
return true;
}
return false;
}
protected String showWfdmDetail(WfdmBean w) {
String s = w.getWfxw() + ": " + w.getWfms();
// 强制措施将显示收缴或扣留项目
s += "| 强制措施 "
+ (TextUtils.isEmpty(w.getQzcslx()) ? "无" : w.getQzcslx());
s += "| " + (ViolationDAO.isYxWfdm(w) ? "有效代码" : "无效代码");
return s;
}
@Override
protected String saveAndCheckVio() {
getViolationFromView(violation);
String err = VerifyData.verifyCommVio(violation, self);
if (!TextUtils.isEmpty(err))
return err;
ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws == null || allWfxws.isEmpty())
return "至少要有一个违法行为";
violation.setWfxw1(allWfxws.get(0));
violation.setWfxw2(allWfxws.size() > 1 ? allWfxws.get(1) : "");
violation.setWfxw3(allWfxws.size() > 2 ? allWfxws.get(2) : "");
violation.setWfxw4(allWfxws.size() > 3 ? allWfxws.get(3) : "");
violation.setWfxw5(allWfxws.size() > 4 ? allWfxws.get(4) : "");
// 强制措施项目
String qzcsError = "第%S个违法代码不可开具强制措施,请到系统配置->强制措施代码模块中查询!";
if (!TextUtils.isEmpty(violation.getWfxw1())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw1(), getContentResolver())))
return String.format(qzcsError, "1");
if (!TextUtils.isEmpty(violation.getWfxw2())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw2(), getContentResolver())))
return String.format(qzcsError, "2");
if (!TextUtils.isEmpty(violation.getWfxw3())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw3(), getContentResolver())))
return String.format(qzcsError, "3");
if (!TextUtils.isEmpty(violation.getWfxw4())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw4(), getContentResolver())))
return String.format(qzcsError, "4");
if (!TextUtils.isEmpty(violation.getWfxw5())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw5(), getContentResolver()))) {
return String.format(qzcsError, "5");
}
String qzxm = "";
String sjxm = "";
// 强制项目和收缴项目保存在一个表中
// 强制项目小于10,收缴项目大于10
if (qzcsMap != null && qzcsMap.size() > 0) {
for (Entry<Integer, Boolean> entry : qzcsMap.entrySet()) {
if (entry.getValue()) {
if (entry.getKey() < 10)
qzxm += entry.getKey();
else
// 收缴项目
sjxm += (entry.getKey() - 10);
}
}
}
if (TextUtils.isEmpty(qzxm)) {
return "至少需要一个强制措施项目";
}
// 强制项目中包含了收缴
if (qzxm.indexOf("5") > -1) {
if (TextUtils.isEmpty(sjxm)) {
return "强制措施包含收缴,却没有提供具体收缴项目";
} else {
violation.setSjxm(sjxm);
if (!TextUtils.isEmpty(sjxm)) {
String sjxmMs = "";
for (int i = 0; i < sjxm.length(); i++) {
sjxmMs += GlobalMethod.getStringFromKVListByKey(
GlobalData.sjxmList,
"1" + sjxm.substring(i, i + 1))
+ ",";
}
if (!TextUtils.isEmpty(sjxmMs))
violation.setSjxmmc(sjxmMs.substring(0,
sjxmMs.length() - 1));
}
violation.setSjwpcfd(GlobalData.grxx.get(GlobalConstant.BMMC));
}
}
violation.setQzcslx(qzxm);
err = VerifyData.verifyQzcsVio(violation, self);
return err;
}
/**
* 显示强制措施项目对话框,用于用户选择强制措施项目
*/
private void showQzcsxmDialog() {
if (qzcsMap.isEmpty()) {
GlobalMethod.showDialog("系统提示", "所有违法行为均无强制措施项目,请检查违法代码", "确定",
self);
return;
}
final String[] ws = new String[qzcsMap.size()];
final boolean[] se = new boolean[qzcsMap.size()];
final ArrayList<Integer> al = new ArrayList<Integer>(qzcsMap.keySet());
// 初始化对话框的显示项
Set<Entry<Integer, Boolean>> set = qzcsMap.entrySet();
int i = 0;
for (Entry<Integer, Boolean> entry : set) {
// 判断是否为收缴项目
if (entry.getKey() > 9)
ws[i] = GlobalMethod.getStringFromKVListByKey(
GlobalData.sjxmList, String.valueOf(entry.getKey()));
else
ws[i] = GlobalMethod.getStringFromKVListByKey(
GlobalData.qzcslxList, String.valueOf(entry.getKey()));
se[i] = entry.getValue();
i++;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请选择强制措施类型");
builder.setMultiChoiceItems(ws, se,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
se[which] = isChecked;
}
}
)
.setNeutralButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int w) {
for (int j = 0; j < se.length; j++) {
qzcsMap.put(al.get(j), se[j]);
}
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.create().show();
}
private ArrayList<String> getWfdmsByEdit() {
ArrayList<String> list = new ArrayList<String>();
String allWfxwTxt = edAllWfxw.getText().toString();
if (!TextUtils.isEmpty(allWfxwTxt)) {
String[] allWfxws = allWfxwTxt.split(",");
if (allWfxws != null && allWfxws.length > 0) {
for (String w : allWfxws) {
list.add(w);
}
}
}
return list;
}
/**
* 将上一个框内的违法代码加入到下一个列表编辑框内<br>
* 同时更新违法代码列表以及强制措施列表
*/
private void addWfdmIntoEditWfxw() {
ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws.size() > 4) {
GlobalMethod.showErrorDialog("最多只能加入五条交通违法行为,请删除一条或多条", self);
return;
}
String newWfxw = edWfxw.getText().toString();
// 加入违法行为列表
if (TextUtils.isEmpty(newWfxw)) {
Toast.makeText(this, "违法行为为空", Toast.LENGTH_LONG).show();
return;
}
WfdmBean wf = ViolationDAO.queryWfxwByWfdm(newWfxw, resolver);
// 查询无此号码或不在有效期内
if (wf == null || !ViolationDAO.isYxWfdm(wf)) {
GlobalMethod.showErrorDialog("不是有效代码,不可以处罚!", self);
return;
}
// 判断是否先前是否已加入相同号码,如果已有,则不执行加入操作
for (int i = 0; i < allWfxws.size(); i++) {
if (TextUtils.equals(wf.getWfxw(), allWfxws.get(i)))
return;
}
allWfxws.add(newWfxw);
// 同步数组与编辑框的内容,同时消除所有强制措施项目和收缴项目,简化程序的逻辑
synQzcslxFromList(allWfxws);
edAllWfxw.setText(synEditFromList(allWfxws));
textWfxwms.setText("");
edWfxw.setText("");
}
/**
* 根据违法代码查找强制措施项目以及收缴项目
*
* @param wf
* @return
*/
private List<Integer> findQzcdxmAndSjxmByWfdm(WfdmBean wf) {
List<Integer> cs = new ArrayList<Integer>();
String qzlx = wf.getQzcslx();
if (TextUtils.isEmpty(qzlx))
return cs;
// 有强制措施内容
for (int j = 0; j < qzlx.length(); j++) {
int key = Integer.valueOf(qzlx.substring(j, j + 1));
cs.add(key);
// 判断是否为收缴项目
if (key == 5) {
for (KeyValueBean kv : GlobalData.sjxmList)
cs.add(Integer.valueOf(kv.getKey()));
}
}
return cs;
}
/**
* 私有方法,同步违法列表与编辑框中的内容
*
* @param wfdms
* @return
*/
private String synEditFromList(ArrayList<String> wfdms) {
StringBuilder s = new StringBuilder();
for (String w : wfdms) {
s.append(w).append(",");
}
if (s.length() > 0)
s.delete(s.length() - 1, s.length());
return s.toString();
}
/**
* 同步违法代码以及强制措施类型<br>
* 此方法会将所有类型选择设为空,所以只能在删除代码后使用
*
* @param wfs 违法代码列表
*/
private void synQzcslxFromList(ArrayList<String> wfs) {
qzcsMap.clear();
if (wfs != null && wfs.size() > 0) {
for (String wfdm : wfs) {
WfdmBean wfxw = ViolationDAO.queryWfxwByWfdm(wfdm, resolver);
if (wfxw == null)
continue;
List<Integer> list = findQzcdxmAndSjxmByWfdm(wfxw);
if (list == null || list.isEmpty())
continue;
for (Integer key : list) {
qzcsMap.put(key, false);
}
}
}
}
/**
* 显示一个多选对话框,用于删除违法代码列表框中的项目
*/
private void showModifyWfxws() {
final ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws.size() < 1) {
return;
}
final String[] ws = new String[allWfxws.size()];
final boolean[] se = new boolean[allWfxws.size()];
// 初始化对话框的显示项
for (int i = 0; i < allWfxws.size(); i++) {
se[i] = true;
ws[i] = showWfdmDetail(ViolationDAO.queryWfxwByWfdm(
allWfxws.get(i), resolver));
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请选择保留一个或多个违法行为");
builder.setMultiChoiceItems(ws, se,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
se[which] = isChecked;
}
}
)
.setNeutralButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int w) {
ArrayList<String> newWfxws = new ArrayList<String>();
for (int k = 0; k < allWfxws.size(); k++) {
if (se[k])
newWfxws.add(allWfxws.get(k));
}
edAllWfxw.setText(synEditFromList(newWfxws));
// 如果是强制措施,删除违法代码后需要同步强制措施类型项目
synQzcslxFromList(newWfxws);
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.create().show();
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (MENU_WFXW_ADD): {
}
return true;
case MENU_WFXW_MOD:
showModifyWfxws();
return true;
}
return false;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
if (v == edAllWfxw) {
Log.e("Violation", "edAllWfxws");
menu.add(Menu.NONE, MENU_WFXW_MOD, Menu.NONE, "修改违法列表");
}
}
}
| UTF-8 | Java | 18,167 | java | VioQzcsActivity.java | Java | [] | null | [] | package com.ntga.jwt;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.Map.Entry;
import java.util.TreeMap;
import com.ntga.bean.JdsPrintBean;
import com.ntga.bean.KeyValueBean;
import com.ntga.bean.VioViolation;
import com.ntga.bean.WfdmBean;
import com.ntga.dao.GlobalConstant;
import com.ntga.dao.GlobalData;
import com.ntga.dao.GlobalMethod;
import com.ntga.dao.PrintJdsTools;
import com.ntga.dao.VerifyData;
import com.ntga.dao.ViolationDAO;
import com.ntga.dao.WsglDAO;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class VioQzcsActivity extends ViolationActivity {
private static final String TAG = "VioQzcsActivity";
private Context self;
private ContentResolver resolver;
private EditText edAllWfxw;
private Button btnAddWfxwList;
private TreeMap<Integer, Boolean> qzcsMap = new TreeMap<Integer, Boolean>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
resolver = this.getContentResolver();
self = this;
edAllWfxw = (EditText) findViewById(R.id.Edit_wfxw_all);
btnAddWfxwList = (Button) findViewById(R.id.But_add_wfxw_list);
jdsbh = WsglDAO.getCurrentJdsbh(GlobalConstant.QZCSPZ, zqmj, resolver);
if (jdsbh == null) {
GlobalMethod.showDialogWithListener("提示信息",
"没有相应的处罚编号,请到文书管理中获取编号", "确定", exitSystem, self);
return;
}
if (WsglDAO.hmNotEqDw(jdsbh)) {
GlobalMethod.showDialogWithListener("提示信息",
"当前文书编号与处罚机关不符,请上交文书后重新获取", "确定", exitSystem, self);
return;
}
// 设置标题
setTitle(getActivityTitle());
textJdsbh.setText("强制措施编号:" + jdsbh.getDqhm());
initViolation();
// violation.setCfzl("2");
wslb = "3";
violation.setWslb(wslb);
violation.setFkje("0");
RelativeLayout r2 = (RelativeLayout) findViewById(R.id.layout_jycx);
r2.removeAllViewsInLayout();
registerForContextMenu(edAllWfxw);
btnAddWfxwList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addWfdmIntoEditWfxw();
}
});
}
@Override
protected String getViolationTitle() {
return "强制措施";
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.force_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (R.id.qzcsxm): {
showQzcsxmDialog();
}
return true;
case (R.id.save_quite):
return menuSaveViolation();
case (R.id.print_preview):
// 预览打印
return menuPreviewViolation();
case (R.id.pre_print):
// 单据已保存,打印决定书
return menuPrintViolation();
case R.id.con_vio:
if (violation != null && isViolationSaved)
showConVio(violation);
else
GlobalMethod.showToast("请保存当前决定书", self);
return true;
case R.id.sys_config:
Intent intent = new Intent(self, ConfigParamSetting.class);
startActivity(intent);
return true;
}
return false;
}
protected String showWfdmDetail(WfdmBean w) {
String s = w.getWfxw() + ": " + w.getWfms();
// 强制措施将显示收缴或扣留项目
s += "| 强制措施 "
+ (TextUtils.isEmpty(w.getQzcslx()) ? "无" : w.getQzcslx());
s += "| " + (ViolationDAO.isYxWfdm(w) ? "有效代码" : "无效代码");
return s;
}
@Override
protected String saveAndCheckVio() {
getViolationFromView(violation);
String err = VerifyData.verifyCommVio(violation, self);
if (!TextUtils.isEmpty(err))
return err;
ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws == null || allWfxws.isEmpty())
return "至少要有一个违法行为";
violation.setWfxw1(allWfxws.get(0));
violation.setWfxw2(allWfxws.size() > 1 ? allWfxws.get(1) : "");
violation.setWfxw3(allWfxws.size() > 2 ? allWfxws.get(2) : "");
violation.setWfxw4(allWfxws.size() > 3 ? allWfxws.get(3) : "");
violation.setWfxw5(allWfxws.size() > 4 ? allWfxws.get(4) : "");
// 强制措施项目
String qzcsError = "第%S个违法代码不可开具强制措施,请到系统配置->强制措施代码模块中查询!";
if (!TextUtils.isEmpty(violation.getWfxw1())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw1(), getContentResolver())))
return String.format(qzcsError, "1");
if (!TextUtils.isEmpty(violation.getWfxw2())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw2(), getContentResolver())))
return String.format(qzcsError, "2");
if (!TextUtils.isEmpty(violation.getWfxw3())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw3(), getContentResolver())))
return String.format(qzcsError, "3");
if (!TextUtils.isEmpty(violation.getWfxw4())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw4(), getContentResolver())))
return String.format(qzcsError, "4");
if (!TextUtils.isEmpty(violation.getWfxw5())
&& TextUtils.isEmpty(ViolationDAO.queryQzcsYj(
violation.getWfxw5(), getContentResolver()))) {
return String.format(qzcsError, "5");
}
String qzxm = "";
String sjxm = "";
// 强制项目和收缴项目保存在一个表中
// 强制项目小于10,收缴项目大于10
if (qzcsMap != null && qzcsMap.size() > 0) {
for (Entry<Integer, Boolean> entry : qzcsMap.entrySet()) {
if (entry.getValue()) {
if (entry.getKey() < 10)
qzxm += entry.getKey();
else
// 收缴项目
sjxm += (entry.getKey() - 10);
}
}
}
if (TextUtils.isEmpty(qzxm)) {
return "至少需要一个强制措施项目";
}
// 强制项目中包含了收缴
if (qzxm.indexOf("5") > -1) {
if (TextUtils.isEmpty(sjxm)) {
return "强制措施包含收缴,却没有提供具体收缴项目";
} else {
violation.setSjxm(sjxm);
if (!TextUtils.isEmpty(sjxm)) {
String sjxmMs = "";
for (int i = 0; i < sjxm.length(); i++) {
sjxmMs += GlobalMethod.getStringFromKVListByKey(
GlobalData.sjxmList,
"1" + sjxm.substring(i, i + 1))
+ ",";
}
if (!TextUtils.isEmpty(sjxmMs))
violation.setSjxmmc(sjxmMs.substring(0,
sjxmMs.length() - 1));
}
violation.setSjwpcfd(GlobalData.grxx.get(GlobalConstant.BMMC));
}
}
violation.setQzcslx(qzxm);
err = VerifyData.verifyQzcsVio(violation, self);
return err;
}
/**
* 显示强制措施项目对话框,用于用户选择强制措施项目
*/
private void showQzcsxmDialog() {
if (qzcsMap.isEmpty()) {
GlobalMethod.showDialog("系统提示", "所有违法行为均无强制措施项目,请检查违法代码", "确定",
self);
return;
}
final String[] ws = new String[qzcsMap.size()];
final boolean[] se = new boolean[qzcsMap.size()];
final ArrayList<Integer> al = new ArrayList<Integer>(qzcsMap.keySet());
// 初始化对话框的显示项
Set<Entry<Integer, Boolean>> set = qzcsMap.entrySet();
int i = 0;
for (Entry<Integer, Boolean> entry : set) {
// 判断是否为收缴项目
if (entry.getKey() > 9)
ws[i] = GlobalMethod.getStringFromKVListByKey(
GlobalData.sjxmList, String.valueOf(entry.getKey()));
else
ws[i] = GlobalMethod.getStringFromKVListByKey(
GlobalData.qzcslxList, String.valueOf(entry.getKey()));
se[i] = entry.getValue();
i++;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请选择强制措施类型");
builder.setMultiChoiceItems(ws, se,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
se[which] = isChecked;
}
}
)
.setNeutralButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int w) {
for (int j = 0; j < se.length; j++) {
qzcsMap.put(al.get(j), se[j]);
}
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.create().show();
}
private ArrayList<String> getWfdmsByEdit() {
ArrayList<String> list = new ArrayList<String>();
String allWfxwTxt = edAllWfxw.getText().toString();
if (!TextUtils.isEmpty(allWfxwTxt)) {
String[] allWfxws = allWfxwTxt.split(",");
if (allWfxws != null && allWfxws.length > 0) {
for (String w : allWfxws) {
list.add(w);
}
}
}
return list;
}
/**
* 将上一个框内的违法代码加入到下一个列表编辑框内<br>
* 同时更新违法代码列表以及强制措施列表
*/
private void addWfdmIntoEditWfxw() {
ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws.size() > 4) {
GlobalMethod.showErrorDialog("最多只能加入五条交通违法行为,请删除一条或多条", self);
return;
}
String newWfxw = edWfxw.getText().toString();
// 加入违法行为列表
if (TextUtils.isEmpty(newWfxw)) {
Toast.makeText(this, "违法行为为空", Toast.LENGTH_LONG).show();
return;
}
WfdmBean wf = ViolationDAO.queryWfxwByWfdm(newWfxw, resolver);
// 查询无此号码或不在有效期内
if (wf == null || !ViolationDAO.isYxWfdm(wf)) {
GlobalMethod.showErrorDialog("不是有效代码,不可以处罚!", self);
return;
}
// 判断是否先前是否已加入相同号码,如果已有,则不执行加入操作
for (int i = 0; i < allWfxws.size(); i++) {
if (TextUtils.equals(wf.getWfxw(), allWfxws.get(i)))
return;
}
allWfxws.add(newWfxw);
// 同步数组与编辑框的内容,同时消除所有强制措施项目和收缴项目,简化程序的逻辑
synQzcslxFromList(allWfxws);
edAllWfxw.setText(synEditFromList(allWfxws));
textWfxwms.setText("");
edWfxw.setText("");
}
/**
* 根据违法代码查找强制措施项目以及收缴项目
*
* @param wf
* @return
*/
private List<Integer> findQzcdxmAndSjxmByWfdm(WfdmBean wf) {
List<Integer> cs = new ArrayList<Integer>();
String qzlx = wf.getQzcslx();
if (TextUtils.isEmpty(qzlx))
return cs;
// 有强制措施内容
for (int j = 0; j < qzlx.length(); j++) {
int key = Integer.valueOf(qzlx.substring(j, j + 1));
cs.add(key);
// 判断是否为收缴项目
if (key == 5) {
for (KeyValueBean kv : GlobalData.sjxmList)
cs.add(Integer.valueOf(kv.getKey()));
}
}
return cs;
}
/**
* 私有方法,同步违法列表与编辑框中的内容
*
* @param wfdms
* @return
*/
private String synEditFromList(ArrayList<String> wfdms) {
StringBuilder s = new StringBuilder();
for (String w : wfdms) {
s.append(w).append(",");
}
if (s.length() > 0)
s.delete(s.length() - 1, s.length());
return s.toString();
}
/**
* 同步违法代码以及强制措施类型<br>
* 此方法会将所有类型选择设为空,所以只能在删除代码后使用
*
* @param wfs 违法代码列表
*/
private void synQzcslxFromList(ArrayList<String> wfs) {
qzcsMap.clear();
if (wfs != null && wfs.size() > 0) {
for (String wfdm : wfs) {
WfdmBean wfxw = ViolationDAO.queryWfxwByWfdm(wfdm, resolver);
if (wfxw == null)
continue;
List<Integer> list = findQzcdxmAndSjxmByWfdm(wfxw);
if (list == null || list.isEmpty())
continue;
for (Integer key : list) {
qzcsMap.put(key, false);
}
}
}
}
/**
* 显示一个多选对话框,用于删除违法代码列表框中的项目
*/
private void showModifyWfxws() {
final ArrayList<String> allWfxws = getWfdmsByEdit();
if (allWfxws.size() < 1) {
return;
}
final String[] ws = new String[allWfxws.size()];
final boolean[] se = new boolean[allWfxws.size()];
// 初始化对话框的显示项
for (int i = 0; i < allWfxws.size(); i++) {
se[i] = true;
ws[i] = showWfdmDetail(ViolationDAO.queryWfxwByWfdm(
allWfxws.get(i), resolver));
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请选择保留一个或多个违法行为");
builder.setMultiChoiceItems(ws, se,
new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
se[which] = isChecked;
}
}
)
.setNeutralButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int w) {
ArrayList<String> newWfxws = new ArrayList<String>();
for (int k = 0; k < allWfxws.size(); k++) {
if (se[k])
newWfxws.add(allWfxws.get(k));
}
edAllWfxw.setText(synEditFromList(newWfxws));
// 如果是强制措施,删除违法代码后需要同步强制措施类型项目
synQzcslxFromList(newWfxws);
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.create().show();
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case (MENU_WFXW_ADD): {
}
return true;
case MENU_WFXW_MOD:
showModifyWfxws();
return true;
}
return false;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
if (v == edAllWfxw) {
Log.e("Violation", "edAllWfxws");
menu.add(Menu.NONE, MENU_WFXW_MOD, Menu.NONE, "修改违法列表");
}
}
}
| 18,167 | 0.516814 | 0.512946 | 479 | 33.075157 | 22.177933 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.609603 | false | false | 7 |
15764d7c5f8e05f096aa9289032a9717447cd221 | 39,479,339,388,295 | bab1459483c3d33f404ad710f8e567a974ee955e | /mango/src/main/java/com/zee/ent/parameter/da/DaCheckTestingParameter.java | 98cd96a96f5b998089ec514b8d4fe2dc4396d157 | [] | no_license | ZeeMenng/HuaPingMango | https://github.com/ZeeMenng/HuaPingMango | d9a0a711aa1c2500e843dfbad30c3d294ddc155a | bda1ea6fb4fe1de74b83dd3175f59ce5f66e70bf | refs/heads/master | 2021-06-18T09:12:02.174000 | 2021-04-20T07:16:05 | 2021-04-20T07:16:05 | 208,407,752 | 0 | 0 | null | false | 2021-08-11T11:39:21 | 2019-09-14T07:53:03 | 2021-04-20T07:17:14 | 2021-08-11T11:39:21 | 246,961 | 0 | 0 | 22 | JavaScript | false | false | package com.zee.ent.parameter.da;
import java.util.*;
import com.zee.ent.extend.da.DaCheckTesting;
import com.zee.ent.generate.da.DaCheckTestingGenEnt;
import com.zee.ent.parameter.base.BaseParameter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @author Zee
* @createDate 2017/05/18 14:54:22
* @updateDate 2018-6-13 19:04:23
* @description 实体类DaCheckTestingParameter,方法参数,自动生成。检测数据表
*/
public class DaCheckTestingParameter extends BaseParameter {
@ApiModel(value = "DaCheckTestingAddList", description = "批量添加DaCheckTesting所需参数")
public static class AddList extends BaseParameter.BaseParamAddList {
@ApiModelProperty(value = "要新增的记录列表 ", required = false)
private ArrayList<DaCheckTesting> entityList = new ArrayList<DaCheckTesting>();
public ArrayList<DaCheckTesting> getEntityList() {
return entityList;
}
public void setEntityList(ArrayList<DaCheckTesting> entityList) {
this.entityList = entityList;
}
}
@ApiModel(value = "DaCheckTestingDeleteByIdList", description = "批量删除DaCheckTesting所需参数")
public static class DeleteByIdList extends BaseParameter.BaseParamDeleteByIdList {
}
@ApiModel(value = "DaCheckTestingUpdateList", description = "批量修改DaCheckTesting所需参数")
public static class UpdateList extends BaseParameter.BaseParamUpdateList {
@ApiModelProperty(value = "要修改为的信息承载实体 ", required = false)
private DaCheckTesting entity = new DaCheckTesting();
public DaCheckTesting getEntity() {
return entity;
}
public void setEntity(DaCheckTesting entity) {
this.entity = entity;
}
}
@ApiModel(value = "DaCheckTestingGetList", description = "模糊查询DaCheckTesting所需参数")
public static class GetList extends BaseParameter.BaseParamGetList {
@ApiModelProperty(value = "实体相关的查询条件 ", required = false)
private EntityRelated entityRelated = new EntityRelated();
public EntityRelated getEntityRelated() {
return entityRelated;
}
public void setEntityRelated(EntityRelated entityRelated) {
this.entityRelated = entityRelated;
}
@ApiModel(value = "DaCheckTestingGetListEntityRelated", description = "模糊查询DaCheckTesting所需的参数,实体类相关。")
public static class EntityRelated extends DaCheckTestingGenEnt{
@ApiModelProperty(value="检测时间查询起止时间。",required=false)
private Date beginCheckDate;
@ApiModelProperty(value="检测时间查询结束时间。",required=false)
private Date endCheckDate;
public Date getBeginCheckDate() {
return this.beginCheckDate;
}
public void setBeginCheckDate(Date beginCheckDate) {
this.beginCheckDate = beginCheckDate;
}
public Date getEndCheckDate() {
return this.endCheckDate;
}
public void setEndCheckDate(Date endCheckDate) {
this.endCheckDate = endCheckDate;
}
}
}
}
| UTF-8 | Java | 3,159 | java | DaCheckTestingParameter.java | Java | [
{
"context": "notations.ApiModelProperty;\r\n\r\n\r\n\r\n/**\r\n * @author Zee\r\n * @createDate 2017/05/18 14:54:22\r\n * @updateDa",
"end": 327,
"score": 0.941798210144043,
"start": 324,
"tag": "USERNAME",
"value": "Zee"
}
] | null | [] | package com.zee.ent.parameter.da;
import java.util.*;
import com.zee.ent.extend.da.DaCheckTesting;
import com.zee.ent.generate.da.DaCheckTestingGenEnt;
import com.zee.ent.parameter.base.BaseParameter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @author Zee
* @createDate 2017/05/18 14:54:22
* @updateDate 2018-6-13 19:04:23
* @description 实体类DaCheckTestingParameter,方法参数,自动生成。检测数据表
*/
public class DaCheckTestingParameter extends BaseParameter {
@ApiModel(value = "DaCheckTestingAddList", description = "批量添加DaCheckTesting所需参数")
public static class AddList extends BaseParameter.BaseParamAddList {
@ApiModelProperty(value = "要新增的记录列表 ", required = false)
private ArrayList<DaCheckTesting> entityList = new ArrayList<DaCheckTesting>();
public ArrayList<DaCheckTesting> getEntityList() {
return entityList;
}
public void setEntityList(ArrayList<DaCheckTesting> entityList) {
this.entityList = entityList;
}
}
@ApiModel(value = "DaCheckTestingDeleteByIdList", description = "批量删除DaCheckTesting所需参数")
public static class DeleteByIdList extends BaseParameter.BaseParamDeleteByIdList {
}
@ApiModel(value = "DaCheckTestingUpdateList", description = "批量修改DaCheckTesting所需参数")
public static class UpdateList extends BaseParameter.BaseParamUpdateList {
@ApiModelProperty(value = "要修改为的信息承载实体 ", required = false)
private DaCheckTesting entity = new DaCheckTesting();
public DaCheckTesting getEntity() {
return entity;
}
public void setEntity(DaCheckTesting entity) {
this.entity = entity;
}
}
@ApiModel(value = "DaCheckTestingGetList", description = "模糊查询DaCheckTesting所需参数")
public static class GetList extends BaseParameter.BaseParamGetList {
@ApiModelProperty(value = "实体相关的查询条件 ", required = false)
private EntityRelated entityRelated = new EntityRelated();
public EntityRelated getEntityRelated() {
return entityRelated;
}
public void setEntityRelated(EntityRelated entityRelated) {
this.entityRelated = entityRelated;
}
@ApiModel(value = "DaCheckTestingGetListEntityRelated", description = "模糊查询DaCheckTesting所需的参数,实体类相关。")
public static class EntityRelated extends DaCheckTestingGenEnt{
@ApiModelProperty(value="检测时间查询起止时间。",required=false)
private Date beginCheckDate;
@ApiModelProperty(value="检测时间查询结束时间。",required=false)
private Date endCheckDate;
public Date getBeginCheckDate() {
return this.beginCheckDate;
}
public void setBeginCheckDate(Date beginCheckDate) {
this.beginCheckDate = beginCheckDate;
}
public Date getEndCheckDate() {
return this.endCheckDate;
}
public void setEndCheckDate(Date endCheckDate) {
this.endCheckDate = endCheckDate;
}
}
}
}
| 3,159 | 0.724786 | 0.715556 | 102 | 26.539215 | 28.544313 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.313725 | false | false | 7 |
b05a576cb7161b0821d1cd56f535af98330a7553 | 39,281,770,934,028 | 9b2628fe64c0a5032dbf11356058ff9918cccf96 | /ExerciciosAula1/src/br/com/cwi/Calculadora.java | 453e27dffb7495a23c1a76314c164689265de2bf | [] | no_license | memeia/CWI-RESET-02 | https://github.com/memeia/CWI-RESET-02 | 7260b5356daa352ccbefbe2ebc0f9bc10a6ad3ba | 2274562f232ff889e2db8e96000913468d7bf332 | refs/heads/main | 2023-03-24T07:30:12.111000 | 2021-03-06T02:52:47 | 2021-03-06T02:52:47 | 336,543,856 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.cwi;
public class Calculadora {
double soma(double numero1, double numero2){
return numero1 + numero2;
}
double subtracao (double numero1, double numero2){
return numero1 - numero2;
}
double multiplicacao (double numero1, double numero2){
return numero1 * numero2;
}
double divisao (double numero1, double numero2){
return numero1 / numero2;
}
}
| UTF-8 | Java | 431 | java | Calculadora.java | Java | [] | null | [] | package br.com.cwi;
public class Calculadora {
double soma(double numero1, double numero2){
return numero1 + numero2;
}
double subtracao (double numero1, double numero2){
return numero1 - numero2;
}
double multiplicacao (double numero1, double numero2){
return numero1 * numero2;
}
double divisao (double numero1, double numero2){
return numero1 / numero2;
}
}
| 431 | 0.645012 | 0.607889 | 21 | 19.523809 | 20.44416 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 7 |
166809bfad4e314399a98e96253f21ff85951169 | 37,778,532,362,351 | 6e8e42ffa90904f548b07cf43f02541bf765a90c | /chapter2/bean/Person.java | 4708baa5bb594834aa8ca8bb4a17673de693d17a | [] | no_license | jieqiyue/kafkaStudy | https://github.com/jieqiyue/kafkaStudy | de657a801b5ccd54c7eafa50455bef0b1770fbeb | e0fa643cc582b7d1f856d26c0e62055f83da051b | refs/heads/main | 2023-07-01T11:11:47.701000 | 2021-08-08T15:28:56 | 2021-08-08T15:28:56 | 393,945,995 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kafkaStudy.chapter2.bean;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
/**
* @Classname Person
* @Description TODO
* @Date 2021/8/6 22:56
* @Created by Jieqiyue
*/
public class Person {
private String name;
private Integer age;
private String extra;
public Person(String name, int age, String extra) {
this.name = name;
this.age = age;
this.extra = extra;
}
public byte[] toByteArr() throws UnsupportedEncodingException {
ByteBuffer allocate = ByteBuffer.allocate(4 + 4 + 4 + name.length() + extra.length());
allocate.putInt(name.length());
allocate.put(name.getBytes("UTF-8"));
allocate.putInt(age);
allocate.putInt(extra.length());
allocate.put(extra.getBytes("UTF-8"));
return allocate.array();
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public Person() {
}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
| UTF-8 | Java | 1,500 | java | Person.java | Java | [
{
"context": "tion TODO\r\n * @Date 2021/8/6 22:56\r\n * @Created by Jieqiyue\r\n */\r\npublic class Person {\r\n private String n",
"end": 280,
"score": 0.9414122700691223,
"start": 272,
"tag": "NAME",
"value": "Jieqiyue"
}
] | null | [] | package kafkaStudy.chapter2.bean;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
/**
* @Classname Person
* @Description TODO
* @Date 2021/8/6 22:56
* @Created by Jieqiyue
*/
public class Person {
private String name;
private Integer age;
private String extra;
public Person(String name, int age, String extra) {
this.name = name;
this.age = age;
this.extra = extra;
}
public byte[] toByteArr() throws UnsupportedEncodingException {
ByteBuffer allocate = ByteBuffer.allocate(4 + 4 + 4 + name.length() + extra.length());
allocate.putInt(name.length());
allocate.put(name.getBytes("UTF-8"));
allocate.putInt(age);
allocate.putInt(extra.length());
allocate.put(extra.getBytes("UTF-8"));
return allocate.array();
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public Person() {
}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
| 1,500 | 0.575333 | 0.564667 | 67 | 20.38806 | 18.306639 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.432836 | false | false | 7 |
dbbc359266f8e4a25540a6bef0527f9a411a7478 | 4,028,679,387,129 | 12756f54c7cf1064dfca7e7987c1c3cd9f6994fa | /seyren-core/src/main/java/com/seyren/core/service/live/MetricsTask.java | 1d009c46075559d40366a138f32b38833020d956 | [
"Apache-2.0"
] | permissive | ExpediaInc/seyren-1 | https://github.com/ExpediaInc/seyren-1 | 5e6cd27678f8b1912689780f02b6a0d6ad5579f8 | 3d49be0d40227f1f2a307e980276dccf337026f9 | refs/heads/master | 2021-01-24T01:36:11.277000 | 2020-03-26T14:23:27 | 2020-03-26T14:23:27 | 37,128,933 | 5 | 7 | NOASSERTION | true | 2020-03-26T14:23:28 | 2015-06-09T11:51:30 | 2020-03-25T05:31:40 | 2020-03-26T14:23:27 | 2,251 | 3 | 3 | 7 | Java | false | false | /**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.seyren.core.service.live;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.seyren.core.domain.Check;
import com.seyren.core.service.schedule.CheckRunner;
import com.seyren.core.service.schedule.CheckRunnerFactory;
import com.seyren.core.store.ChecksStore;
public class MetricsTask implements Runnable {
private Set<Metric> metrics;
private ChecksStore checksStore;
private CheckRunnerFactory checkRunnerFactory;
public MetricsTask(Set<Metric> metrics, ChecksStore checksStore, CheckRunnerFactory checkRunnerFactory) {
this.metrics = metrics;
this.checksStore = checksStore;
this.checkRunnerFactory = checkRunnerFactory;
}
@Override
public void run() {
final List<Check> checks = checksStore.getChecks(true, true).getValues();
for (final Check check : checks) {
Iterator<Metric> metricByName = Iterables.filter(metrics, new FindByName(check.getName())).iterator();
if (metricByName.hasNext()) {
Metric found = metricByName.next();
CheckRunner runner = checkRunnerFactory.create(check, found.getValue());
runner.run();
}
}
}
private static class FindByName implements Predicate<Metric> {
private String name;
private FindByName(String name) {
this.name = name;
}
@Override
public boolean apply(Metric metric) {
return Objects.equal(metric.getName(), name);
}
}
}
| UTF-8 | Java | 2,247 | java | MetricsTask.java | Java | [] | null | [] | /**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.seyren.core.service.live;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.seyren.core.domain.Check;
import com.seyren.core.service.schedule.CheckRunner;
import com.seyren.core.service.schedule.CheckRunnerFactory;
import com.seyren.core.store.ChecksStore;
public class MetricsTask implements Runnable {
private Set<Metric> metrics;
private ChecksStore checksStore;
private CheckRunnerFactory checkRunnerFactory;
public MetricsTask(Set<Metric> metrics, ChecksStore checksStore, CheckRunnerFactory checkRunnerFactory) {
this.metrics = metrics;
this.checksStore = checksStore;
this.checkRunnerFactory = checkRunnerFactory;
}
@Override
public void run() {
final List<Check> checks = checksStore.getChecks(true, true).getValues();
for (final Check check : checks) {
Iterator<Metric> metricByName = Iterables.filter(metrics, new FindByName(check.getName())).iterator();
if (metricByName.hasNext()) {
Metric found = metricByName.next();
CheckRunner runner = checkRunnerFactory.create(check, found.getValue());
runner.run();
}
}
}
private static class FindByName implements Predicate<Metric> {
private String name;
private FindByName(String name) {
this.name = name;
}
@Override
public boolean apply(Metric metric) {
return Objects.equal(metric.getName(), name);
}
}
}
| 2,247 | 0.694259 | 0.692479 | 64 | 34.109375 | 27.823168 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5625 | false | false | 7 |
2986fb1ab0fe63371a6dd6e495453e55ce450c3b | 34,540,127,025,144 | 5113556e4267df06928bfba045acc98f4873b9de | /hrmclient-master/hrmclient-master/java/kr/co/infopub/chapter/s195/model/EmployeeRestJsonDao.java | 0ccae3be45ec9d846685fe0772cfc92de5e5c531 | [] | no_license | msheo/edu_springFramework | https://github.com/msheo/edu_springFramework | 13c29db14daa68a12d00cb33c466aa9c8c5089b7 | fd957ac3634406297f774c393272bebc6cd051a6 | refs/heads/master | 2020-03-18T13:57:14.618000 | 2018-05-25T08:22:14 | 2018-05-25T08:22:14 | 134,820,052 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.co.infopub.chapter.s195.model;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.web.client.RestTemplate;
import kr.co.infopub.chapter.s195.dto.DepCountDto;
import kr.co.infopub.chapter.s195.dto.DepartmentDto;
import kr.co.infopub.chapter.s195.dto.EmployeeDto;
import kr.co.infopub.chapter.s195.help.BoolResult;
import kr.co.infopub.chapter.s195.help.NumberResult;
public class EmployeeRestJsonDao {
public static final String REST_SERVICE_URI = "http://localhost:8199/humans/api";
public static int tI(Object obj){
if(obj==null){ return 0;
}else {
return Integer.parseInt(obj.toString());
}
}
public static double td(Object obj){
if(obj==null){ return 0.0;
}else {
return Double.parseDouble(obj.toString());
}
}
public static String ts(Object obj){
if(obj==null){ return "";
}else {
return (String)obj;
}
}
public static java.sql.Date tq(String obj){
if(obj==null || obj.equals("")){
return new java.sql.Date(new java.util.Date().getTime());
}else {
return java.sql.Date.valueOf(obj);
}
}
public static String to__(String v){
return v.replaceAll(" ", "%20");
}
public static String __to(String v){
return v.replaceAll("%20", " ");
}
public List<EmployeeDto> findAllEmployees() throws SQLException{
System.out.println("Testing findAllEmployees API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllEmployees", List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllEmployees exist----------");
}
return lists;
}
public List<DepartmentDto> findAllDepartments () throws SQLException{
System.out.println("Testing findAllDepartments API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepartments", List.class);
List<DepartmentDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepartmentDto dto=new DepartmentDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setManager_id(tI(map.get("manager_id")));
dto.setLocation_id(tI(map.get("location_id")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepartments exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByDepartName(String department_name)throws SQLException{
System.out.println("Testing findEmployeesByDepartName API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(
REST_SERVICE_URI+"/findEmployeesByDepartName/"+to__(department_name), List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByDepartName exist----------");
}
return lists;
}
public int getEmployeesTotal()throws SQLException{
System.out.println("Testing getUser API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.getForObject(REST_SERVICE_URI+"/getEmployeesTotal", NumberResult.class);
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
public List<DepartmentDto> findAllDepartments2()throws SQLException{
System.out.println("Testing findAllDepartments2 API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepartments2", List.class);
List<DepartmentDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepartmentDto dto=new DepartmentDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setManager_id(tI(map.get("manager_id")));
dto.setLocation_id(tI(map.get("location_id")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepartments2 exist----------");
}
return lists;
}
public List<DepCountDto> findAllDepCounts() throws SQLException{
System.out.println("Testing findAllDepCounts API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepCounts", List.class);
List<DepCountDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepCountDto dto=new DepCountDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setCount(tI(map.get("count")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepCounts exist----------");
}
return lists;
}
public List<String> findAllJobs ()throws SQLException{
System.out.println("Testing findAllJobs API-----------");
RestTemplate restTemplate = new RestTemplate();
List<Object> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllJobs", List.class);
List<String> lists=new ArrayList<>();
if(usersMap!=null){
for(Object dto : usersMap){
lists.add((String)dto);
}
}else{
System.out.println("No findAllDepCounts exist----------");
}
return lists;
}
public List<EmployeeDto> findTreeManagerInEmployee () throws SQLException{
System.out.println("Testing findTreeManagerInEmployee API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findTreeManagerInEmployee", List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
//dto.setEmail(ts(map.get("email")));
//dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
//dto.setPhoneNumber(ts(map.get("phoneNumber")));
//dto.setHireDate(tq(ts(map.get("hireDate"))));
//dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
//dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
dto.setOrder2(ts(map.get("order2")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findTreeManagerInEmployee exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByManagerId (String managerId) throws SQLException{
System.out.println("Testing findEmployeesByManagerId API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeesByManagerId/"+managerId, List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByManagerId exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByEmpId (String employeeId) throws SQLException{
System.out.println("Testing findEmployeesByEmpId API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeesByEmpId/"+employeeId, List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//dto.setOrder2(ts(map.get("order2")));
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByEmpId exist----------");
}
return lists;
}
public EmployeeDto findEmployeeById (String employeeId)throws SQLException{
System.out.println("Testing getUser API----------");
RestTemplate restTemplate = new RestTemplate();
EmployeeDto nresult = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeeById/"+employeeId, EmployeeDto.class);
return nresult;
}
public List<EmployeeDto> findManagersByName(String name)throws SQLException{
System.out.println("Testing findManagersByName API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap=null;
if(name==null || name.trim().equals("")){
usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findAllEmployees", List.class);
}else{
usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findManagersByName/"+__to(name), List.class);
}
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//dto.setOrder2(ts(map.get("order2")));
lists.add(dto);
}
}else{
System.out.println("No findManagersByName exist----------");
}
return lists;
}
public int getTreeMaxLevel()throws SQLException{
System.out.println("Testing getTreeMaxLevel API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.getForObject(REST_SERVICE_URI+"/getTreeMaxLevel", NumberResult.class);
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
public int addEmployee (EmployeeDto emp)throws SQLException{
System.out.println("Testing addEmployee API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/addEmployee", emp, NumberResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
//put???
public boolean updateEmployee(EmployeeDto emp)throws SQLException{
System.out.println("Testing updateEmployee API----------");
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/updateEmployee", emp, BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public boolean updateJobHistory(EmployeeDto emp)throws SQLException{
System.out.println("Testing updateJobHistory API----------");
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/updateJobHistory", emp, BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public boolean deleteEmployee(EmployeeDto emp)throws SQLException{
System.out.println("Testing deleteEmployee API----------");
/* RestTemplate restTemplate = new RestTemplate();
restTemplate.delete(REST_SERVICE_URI+"/deleteEmployee/"+employeeId);
return true;*/
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/deleteEmployee/"+emp.getEmployeeId(), null ,BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public static void main(String[] args) {
EmployeeRestJsonDao jdao=new EmployeeRestJsonDao();
try {
// 1)
List<EmployeeDto> femps=jdao.findAllEmployees() ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());
// 2)
/* List<DepartmentDto> femps=jdao.findAllDepartments() ;
for(DepartmentDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 3)
/* List<EmployeeDto> femps=jdao.findEmployeesByDepartName("Human Resources") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());
*/
// 4)
/* int count= jdao.getEmployeesTotal();
System.out.println( "getEmployeesTotal ---------------->"+count);*/
// 5)
/* List<DepartmentDto> femps=jdao.findAllDepartments2() ;
for(DepartmentDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 6)
/* List<DepCountDto> femps=jdao.findAllDepCounts() ;
for(DepCountDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 7)
/* List<String> femps=jdao.findAllJobs ();
for(String femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 8)
/* List<EmployeeDto> femps=jdao.findTreeManagerInEmployee() ;
for(EmployeeDto femp: femps){
System.out.println(femp.getOrder2());
}
System.out.println( "Size ---------------->"+femps.size());*/
// 9) findEmployeesByManagerId/100
/* List<EmployeeDto> femps=jdao.findEmployeesByManagerId("100") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 10) List<EmployeeDto> findEmployeesByEmpId (String employeeId)
/* List<EmployeeDto> femps=jdao.findEmployeesByEmpId("101") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 11) EmployeeDto findEmployeeById (String employeeId)
/* EmployeeDto dto=jdao.findEmployeeById ("101");
System.out.println( dto);*/
// 12) findManagersByName(String name)
/* List<EmployeeDto> femps=jdao.findManagersByName("king") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 13) public int getTreeMaxLevel ()throws Exception;
/* int count= jdao.getTreeMaxLevel();
System.out.println( "getTreeMaxLevel ---------------->"+count);*/
// 14) int addEmployee (EmployeeDto emp)
/* EmployeeDto dto=new EmployeeDto();
dto.setCommissionPct(0.0);
dto.setDepartmantId(60);
dto.setEmail("Jongu");
dto.setFirstName("Jongu");
dto.setLastName("Lee");
dto.setHireDate(java.sql.Date.valueOf("2016-05-04"));
dto.setJobId("AD_PRES");
dto.setManagerId(101);
dto.setSalary(3456.78);
dto.setPhoneNumber("010.6789.7890");
int count= jdao.addEmployee(dto);
System.out.println( "addEmployee ---------------->"+count);*/
// 15)
/* EmployeeDto dto=new EmployeeDto();
dto.setEmployeeId(361);
dto.setCommissionPct(0.0);
dto.setDepartmantId(70);
dto.setEmail("Jongu");
dto.setFirstName("Jongu");
dto.setLastName("Lee");
dto.setHireDate(java.sql.Date.valueOf("2016-05-04"));
dto.setJobId("SA_MAN");
dto.setManagerId(204);
dto.setSalary(3456.78);
dto.setPhoneNumber("010.6789.7890");
boolean count= jdao.updateEmployee(dto);
System.out.println( "updateEmployee ---------------->"+count);*/
// 16) delete
/* boolean count= jdao.deleteEmployee("360");
System.out.println( "deleteEmployee ---------------->"+count);*/
} catch (SQLException e) {
System.out.println(e);
}
}
}
| UTF-8 | Java | 20,714 | java | EmployeeRestJsonDao.java | Java | [
{
"context": "ry\")));\n \tdto.setFirstName(ts(map.get(\"firstName\")));\n \tdto.setPhoneNumber(ts(map.get(\"",
"end": 13430,
"score": 0.968874454498291,
"start": 13421,
"tag": "NAME",
"value": "firstName"
},
{
"context": ");\n\t\t\tdto.setEmail(\"Jongu\");\n\t\... | null | [] | package kr.co.infopub.chapter.s195.model;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.web.client.RestTemplate;
import kr.co.infopub.chapter.s195.dto.DepCountDto;
import kr.co.infopub.chapter.s195.dto.DepartmentDto;
import kr.co.infopub.chapter.s195.dto.EmployeeDto;
import kr.co.infopub.chapter.s195.help.BoolResult;
import kr.co.infopub.chapter.s195.help.NumberResult;
public class EmployeeRestJsonDao {
public static final String REST_SERVICE_URI = "http://localhost:8199/humans/api";
public static int tI(Object obj){
if(obj==null){ return 0;
}else {
return Integer.parseInt(obj.toString());
}
}
public static double td(Object obj){
if(obj==null){ return 0.0;
}else {
return Double.parseDouble(obj.toString());
}
}
public static String ts(Object obj){
if(obj==null){ return "";
}else {
return (String)obj;
}
}
public static java.sql.Date tq(String obj){
if(obj==null || obj.equals("")){
return new java.sql.Date(new java.util.Date().getTime());
}else {
return java.sql.Date.valueOf(obj);
}
}
public static String to__(String v){
return v.replaceAll(" ", "%20");
}
public static String __to(String v){
return v.replaceAll("%20", " ");
}
public List<EmployeeDto> findAllEmployees() throws SQLException{
System.out.println("Testing findAllEmployees API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllEmployees", List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllEmployees exist----------");
}
return lists;
}
public List<DepartmentDto> findAllDepartments () throws SQLException{
System.out.println("Testing findAllDepartments API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepartments", List.class);
List<DepartmentDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepartmentDto dto=new DepartmentDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setManager_id(tI(map.get("manager_id")));
dto.setLocation_id(tI(map.get("location_id")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepartments exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByDepartName(String department_name)throws SQLException{
System.out.println("Testing findEmployeesByDepartName API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(
REST_SERVICE_URI+"/findEmployeesByDepartName/"+to__(department_name), List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByDepartName exist----------");
}
return lists;
}
public int getEmployeesTotal()throws SQLException{
System.out.println("Testing getUser API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.getForObject(REST_SERVICE_URI+"/getEmployeesTotal", NumberResult.class);
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
public List<DepartmentDto> findAllDepartments2()throws SQLException{
System.out.println("Testing findAllDepartments2 API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepartments2", List.class);
List<DepartmentDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepartmentDto dto=new DepartmentDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setManager_id(tI(map.get("manager_id")));
dto.setLocation_id(tI(map.get("location_id")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepartments2 exist----------");
}
return lists;
}
public List<DepCountDto> findAllDepCounts() throws SQLException{
System.out.println("Testing findAllDepCounts API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllDepCounts", List.class);
List<DepCountDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
DepCountDto dto=new DepCountDto();
dto.setDepartment_id(tI(map.get("department_id")));
dto.setDepartment_name(ts(map.get("department_name")));
dto.setCount(tI(map.get("count")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findAllDepCounts exist----------");
}
return lists;
}
public List<String> findAllJobs ()throws SQLException{
System.out.println("Testing findAllJobs API-----------");
RestTemplate restTemplate = new RestTemplate();
List<Object> usersMap =
restTemplate.getForObject(REST_SERVICE_URI+"/findAllJobs", List.class);
List<String> lists=new ArrayList<>();
if(usersMap!=null){
for(Object dto : usersMap){
lists.add((String)dto);
}
}else{
System.out.println("No findAllDepCounts exist----------");
}
return lists;
}
public List<EmployeeDto> findTreeManagerInEmployee () throws SQLException{
System.out.println("Testing findTreeManagerInEmployee API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findTreeManagerInEmployee", List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
//dto.setEmail(ts(map.get("email")));
//dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
//dto.setPhoneNumber(ts(map.get("phoneNumber")));
//dto.setHireDate(tq(ts(map.get("hireDate"))));
//dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
//dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
dto.setOrder2(ts(map.get("order2")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findTreeManagerInEmployee exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByManagerId (String managerId) throws SQLException{
System.out.println("Testing findEmployeesByManagerId API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeesByManagerId/"+managerId, List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//System.out.println(dto);
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByManagerId exist----------");
}
return lists;
}
public List<EmployeeDto> findEmployeesByEmpId (String employeeId) throws SQLException{
System.out.println("Testing findEmployeesByEmpId API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeesByEmpId/"+employeeId, List.class);
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//dto.setOrder2(ts(map.get("order2")));
lists.add(dto);
}
}else{
System.out.println("No findEmployeesByEmpId exist----------");
}
return lists;
}
public EmployeeDto findEmployeeById (String employeeId)throws SQLException{
System.out.println("Testing getUser API----------");
RestTemplate restTemplate = new RestTemplate();
EmployeeDto nresult = restTemplate.getForObject(REST_SERVICE_URI+"/findEmployeeById/"+employeeId, EmployeeDto.class);
return nresult;
}
public List<EmployeeDto> findManagersByName(String name)throws SQLException{
System.out.println("Testing findManagersByName API-----------");
RestTemplate restTemplate = new RestTemplate();
List<LinkedHashMap<String, Object>> usersMap=null;
if(name==null || name.trim().equals("")){
usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findAllEmployees", List.class);
}else{
usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/findManagersByName/"+__to(name), List.class);
}
List<EmployeeDto> lists=new ArrayList<>();
if(usersMap!=null){
for(LinkedHashMap<String, Object> map : usersMap){
EmployeeDto dto=new EmployeeDto();
dto.setEmail(ts(map.get("email")));
dto.setSalary(td(map.get("salary")));
dto.setFirstName(ts(map.get("firstName")));
dto.setPhoneNumber(ts(map.get("phoneNumber")));
dto.setHireDate(tq(ts(map.get("hireDate"))));
dto.setJobId(ts(map.get("jobId")));
dto.setEmployeeId(tI(map.get("employeeId")));
dto.setLastName(ts(map.get("lastName")));
dto.setManagerId(tI(map.get("managerId")));
dto.setCommissionPct(td(map.get("commissionPct")));
dto.setDepartmantId(tI(map.get("departmantId")));
//dto.setOrder2(ts(map.get("order2")));
lists.add(dto);
}
}else{
System.out.println("No findManagersByName exist----------");
}
return lists;
}
public int getTreeMaxLevel()throws SQLException{
System.out.println("Testing getTreeMaxLevel API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.getForObject(REST_SERVICE_URI+"/getTreeMaxLevel", NumberResult.class);
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
public int addEmployee (EmployeeDto emp)throws SQLException{
System.out.println("Testing addEmployee API----------");
RestTemplate restTemplate = new RestTemplate();
NumberResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/addEmployee", emp, NumberResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.getCount();
}else{
return 0;
}
}
//put???
public boolean updateEmployee(EmployeeDto emp)throws SQLException{
System.out.println("Testing updateEmployee API----------");
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/updateEmployee", emp, BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public boolean updateJobHistory(EmployeeDto emp)throws SQLException{
System.out.println("Testing updateJobHistory API----------");
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/updateJobHistory", emp, BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public boolean deleteEmployee(EmployeeDto emp)throws SQLException{
System.out.println("Testing deleteEmployee API----------");
/* RestTemplate restTemplate = new RestTemplate();
restTemplate.delete(REST_SERVICE_URI+"/deleteEmployee/"+employeeId);
return true;*/
RestTemplate restTemplate = new RestTemplate();
BoolResult nresult = restTemplate.postForObject(REST_SERVICE_URI+"/deleteEmployee/"+emp.getEmployeeId(), null ,BoolResult.class);
//System.out.println("Location : "+uri.toASCIIString());
if(nresult.getState().equals("succ")){
return nresult.isCount();
}else{
return false;
}
}
public static void main(String[] args) {
EmployeeRestJsonDao jdao=new EmployeeRestJsonDao();
try {
// 1)
List<EmployeeDto> femps=jdao.findAllEmployees() ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());
// 2)
/* List<DepartmentDto> femps=jdao.findAllDepartments() ;
for(DepartmentDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 3)
/* List<EmployeeDto> femps=jdao.findEmployeesByDepartName("Human Resources") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());
*/
// 4)
/* int count= jdao.getEmployeesTotal();
System.out.println( "getEmployeesTotal ---------------->"+count);*/
// 5)
/* List<DepartmentDto> femps=jdao.findAllDepartments2() ;
for(DepartmentDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 6)
/* List<DepCountDto> femps=jdao.findAllDepCounts() ;
for(DepCountDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 7)
/* List<String> femps=jdao.findAllJobs ();
for(String femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 8)
/* List<EmployeeDto> femps=jdao.findTreeManagerInEmployee() ;
for(EmployeeDto femp: femps){
System.out.println(femp.getOrder2());
}
System.out.println( "Size ---------------->"+femps.size());*/
// 9) findEmployeesByManagerId/100
/* List<EmployeeDto> femps=jdao.findEmployeesByManagerId("100") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 10) List<EmployeeDto> findEmployeesByEmpId (String employeeId)
/* List<EmployeeDto> femps=jdao.findEmployeesByEmpId("101") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 11) EmployeeDto findEmployeeById (String employeeId)
/* EmployeeDto dto=jdao.findEmployeeById ("101");
System.out.println( dto);*/
// 12) findManagersByName(String name)
/* List<EmployeeDto> femps=jdao.findManagersByName("king") ;
for(EmployeeDto femp: femps){
System.out.println(femp);
}
System.out.println( "Size ---------------->"+femps.size());*/
// 13) public int getTreeMaxLevel ()throws Exception;
/* int count= jdao.getTreeMaxLevel();
System.out.println( "getTreeMaxLevel ---------------->"+count);*/
// 14) int addEmployee (EmployeeDto emp)
/* EmployeeDto dto=new EmployeeDto();
dto.setCommissionPct(0.0);
dto.setDepartmantId(60);
dto.setEmail("Jongu");
dto.setFirstName("Jongu");
dto.setLastName("Lee");
dto.setHireDate(java.sql.Date.valueOf("2016-05-04"));
dto.setJobId("AD_PRES");
dto.setManagerId(101);
dto.setSalary(3456.78);
dto.setPhoneNumber("010.6789.7890");
int count= jdao.addEmployee(dto);
System.out.println( "addEmployee ---------------->"+count);*/
// 15)
/* EmployeeDto dto=new EmployeeDto();
dto.setEmployeeId(361);
dto.setCommissionPct(0.0);
dto.setDepartmantId(70);
dto.setEmail("Jongu");
dto.setFirstName("Jongu");
dto.setLastName("Lee");
dto.setHireDate(java.sql.Date.valueOf("2016-05-04"));
dto.setJobId("SA_MAN");
dto.setManagerId(204);
dto.setSalary(3456.78);
dto.setPhoneNumber("010.6789.7890");
boolean count= jdao.updateEmployee(dto);
System.out.println( "updateEmployee ---------------->"+count);*/
// 16) delete
/* boolean count= jdao.deleteEmployee("360");
System.out.println( "deleteEmployee ---------------->"+count);*/
} catch (SQLException e) {
System.out.println(e);
}
}
}
| 20,714 | 0.612629 | 0.605436 | 498 | 40.594376 | 26.684008 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.967871 | false | false | 7 |
37707f9290165a496e2873fab4f1e3fc48082238 | 36,335,423,353,054 | 9c886fbabc88270a431b9c9c6adc5f2986b9e5dd | /src/ID_Correct.java | 20597b067914963560c158a0703156700b66522e | [] | no_license | studymakemehappier/GreenSearchServer | https://github.com/studymakemehappier/GreenSearchServer | 7a22cc2f866e79639cf47d127dbd1328c58a0425 | 5657deb07edbddd7027f0aaeba73473878e007ab | refs/heads/main | 2023-03-16T15:17:12.018000 | 2021-03-10T06:08:59 | 2021-03-10T06:08:59 | 346,534,965 | 0 | 0 | null | true | 2021-03-11T00:51:42 | 2021-03-11T00:51:42 | 2021-03-10T06:09:01 | 2021-03-10T06:08:59 | 11,462 | 0 | 0 | 0 | null | false | false | import java.sql.ResultSet;
import java.sql.SQLException;
public class ID_Correct {
public static void main(String[] args) throws SQLException {
DatabaseHelper databaseHelper=new DatabaseHelper();
databaseHelper.init();
databaseHelper.ChooseDatabase("ELEMENT");
DatabaseHelper databaseHelper1=new DatabaseHelper();
databaseHelper1.init();
databaseHelper1.ChooseDatabase("ELEMENT");
ResultSet wrongele=databaseHelper.ExecuteQuery("SELECT ID FROM ELEMENT WHERE ID>1006588;");
while(wrongele.next()){
int id=wrongele.getInt("ID");
int id1=id-313;
String SQL="UPDATE ELEMENT SET ID="+id1+" WHERE ID="+id;
databaseHelper1.ExecuteSQL(SQL);
}
}
}
| UTF-8 | Java | 728 | java | ID_Correct.java | Java | [] | null | [] | import java.sql.ResultSet;
import java.sql.SQLException;
public class ID_Correct {
public static void main(String[] args) throws SQLException {
DatabaseHelper databaseHelper=new DatabaseHelper();
databaseHelper.init();
databaseHelper.ChooseDatabase("ELEMENT");
DatabaseHelper databaseHelper1=new DatabaseHelper();
databaseHelper1.init();
databaseHelper1.ChooseDatabase("ELEMENT");
ResultSet wrongele=databaseHelper.ExecuteQuery("SELECT ID FROM ELEMENT WHERE ID>1006588;");
while(wrongele.next()){
int id=wrongele.getInt("ID");
int id1=id-313;
String SQL="UPDATE ELEMENT SET ID="+id1+" WHERE ID="+id;
databaseHelper1.ExecuteSQL(SQL);
}
}
}
| 728 | 0.695055 | 0.673077 | 20 | 34.400002 | 23.618637 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.7 | false | false | 7 |
7d2884090e9db09390653a13e64e8f2a7fe58817 | 37,280,316,144,260 | 7e7d879f7c84a4ef3b52bbcf355141f667f70d5e | /graduation_design/src/com/etimeci/ssm/service/SupplierService.java | a779c50da4ff0a7a9f3f75b9b523c93901d983f0 | [] | no_license | lijilihang/lijisdaima | https://github.com/lijilihang/lijisdaima | 0293a370e30e0615c63c3d507224dc750749f7fc | 67ac58ce251ecebe2d6b5765aaada161db1b2f5b | refs/heads/master | 2021-01-25T11:39:27.644000 | 2018-07-28T05:49:19 | 2018-07-28T05:49:19 | 123,414,702 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.etimeci.ssm.service;
import java.util.List;
import com.etimeci.ssm.entity.Supplier;
public interface SupplierService {
public int insertSupplier(Supplier Supplier);
public List<Supplier> query(String suName);
public List<Supplier> findSupplierById(Integer suId);
public void updateSupplier(Supplier supplier);
public void deleteSupplier(Integer suId);
}
| UTF-8 | Java | 385 | java | SupplierService.java | Java | [] | null | [] | package com.etimeci.ssm.service;
import java.util.List;
import com.etimeci.ssm.entity.Supplier;
public interface SupplierService {
public int insertSupplier(Supplier Supplier);
public List<Supplier> query(String suName);
public List<Supplier> findSupplierById(Integer suId);
public void updateSupplier(Supplier supplier);
public void deleteSupplier(Integer suId);
}
| 385 | 0.784416 | 0.784416 | 12 | 30.083334 | 18.856733 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.083333 | false | false | 7 |
0194dcc6bc8e8e48e8d53a73cd9b625720de72ee | 35,485,019,800,715 | 605fb3d7fd8afe9bc8fd16bfc44d5200cdbacbac | /luna-commons-api/src/main/java/com/luna/api/city/CountryCodeDO.java | 7abcd0c2cd4adf21b489e788b0845227084749ca | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | lunasaw/luna-commons | https://github.com/lunasaw/luna-commons | 3165ed9d77ce7b1a71c9985da21a659eb054795c | ce8d57e25fa526112940ca56ba17b07948a71488 | refs/heads/master | 2023-06-02T06:16:02.512000 | 2021-06-18T00:43:29 | 2021-06-18T00:43:29 | 377,870,051 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.luna.api.city;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.luna.file.file.FileEditUtil;
import java.util.List;
public class CountryCodeDO {
private List<ProvinceDO> provinces;
public List<ProvinceDO> getProvinces() {
return provinces;
}
public void setProvinces(List<ProvinceDO> provinces) {
this.provinces = provinces;
}
public static void main(String[] args) {
String s = FileEditUtil.readFile("/Users/luna_mac/Documents/luna-project/luna-commons/luna-commons-api/src/main/java/com/luna/api/city/city.json");
CountryCodeDO countryCodeDO = JSON.parseObject(s, CountryCodeDO.class);
System.out.println(JSON.toJSONString(countryCodeDO));
}
}
| UTF-8 | Java | 779 | java | CountryCodeDO.java | Java | [
{
"context": "\n String s = FileEditUtil.readFile(\"/Users/luna_mac/Documents/luna-project/luna-commons/luna-commons-",
"end": 530,
"score": 0.9957295656204224,
"start": 522,
"tag": "USERNAME",
"value": "luna_mac"
}
] | null | [] | package com.luna.api.city;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.luna.file.file.FileEditUtil;
import java.util.List;
public class CountryCodeDO {
private List<ProvinceDO> provinces;
public List<ProvinceDO> getProvinces() {
return provinces;
}
public void setProvinces(List<ProvinceDO> provinces) {
this.provinces = provinces;
}
public static void main(String[] args) {
String s = FileEditUtil.readFile("/Users/luna_mac/Documents/luna-project/luna-commons/luna-commons-api/src/main/java/com/luna/api/city/city.json");
CountryCodeDO countryCodeDO = JSON.parseObject(s, CountryCodeDO.class);
System.out.println(JSON.toJSONString(countryCodeDO));
}
}
| 779 | 0.722721 | 0.722721 | 26 | 28.961538 | 33.864529 | 155 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false | 7 |
a309a6186632ee37d4ccddbc5be2cf5dc3eeb398 | 29,386,166,276,542 | 380366cde7f499290a61f8372034744cae137a4e | /adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImpl.java | 7c35be02a4c7a9ce3c15573720d6498273eea435 | [
"Apache-2.0"
] | permissive | onap/so | https://github.com/onap/so | 82a219ed0e5559a94d630cc9956180dbab0d33b8 | 43224c4dc5ff3bf67979f480d8628f300497da07 | refs/heads/master | 2023-08-21T00:09:36.560000 | 2023-07-03T16:30:22 | 2023-07-03T16:30:55 | 115,077,083 | 18 | 25 | Apache-2.0 | false | 2022-03-21T09:59:49 | 2017-12-22T04:39:28 | 2022-01-18T13:12:09 | 2022-03-21T09:59:49 | 143,795 | 15 | 19 | 2 | Java | false | false | /*-
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
*/
package org.onap.so.adapters.sdnc.impl;
import javax.annotation.PostConstruct;
import javax.jws.WebService;
import javax.servlet.http.HttpServletResponse;
import org.onap.so.logger.LoggingAnchor;
import org.onap.so.adapters.sdnc.SDNCAdapterPortType;
import org.onap.so.adapters.sdnc.SDNCAdapterRequest;
import org.onap.so.adapters.sdnc.SDNCAdapterResponse;
import org.onap.logging.filter.base.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
// BPEL SDNCAdapter SOAP Web Service implementation
@WebService(serviceName = "SDNCAdapterService", endpointInterface = "org.onap.so.adapters.sdnc.SDNCAdapterPortType",
targetNamespace = "http://org.onap/workflow/sdnc/adapter/wsdl/v1")
@Component
public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
private static Logger logger = LoggerFactory.getLogger(SDNCAdapterPortTypeImpl.class);
@Autowired
private SDNCRestClient sdncClient;
@PostConstruct
public void init() {
logger.info(LoggingAnchor.THREE, MessageEnum.RA_INIT_SDNC_ADAPTER.toString(), "SDNC", "SDNCAdapterPortType");
}
/**
* Health Check web method. Does nothing but return to show the adapter is deployed.
*/
@Override
public void healthCheck() {
logger.debug("Health check call in SDNC Adapter");
}
@Override
public SDNCAdapterResponse sdncAdapter(SDNCAdapterRequest bpelRequest) {
String bpelReqId = bpelRequest.getRequestHeader().getRequestId();
String callbackUrl = bpelRequest.getRequestHeader().getCallbackUrl();
try {
sdncClient.executeRequest(bpelRequest);
} catch (Exception e) {
String respMsg = "Error sending request to SDNC. Failed to start SDNC Client thread " + e.getMessage();
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SEND_REQUEST_SDNC_ERR.toString(), "SDNC",
ErrorCode.DataError.getValue(), respMsg, e);
SDNCResponse sdncResp = new SDNCResponse(bpelReqId);
sdncResp.setRespCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
sdncResp.setRespMsg(respMsg);
sdncClient.sendRespToBpel(callbackUrl, sdncResp);
}
return (new SDNCAdapterResponse());
}
}
| UTF-8 | Java | 3,528 | java | SDNCAdapterPortTypeImpl.java | Java | [] | null | [] | /*-
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
*/
package org.onap.so.adapters.sdnc.impl;
import javax.annotation.PostConstruct;
import javax.jws.WebService;
import javax.servlet.http.HttpServletResponse;
import org.onap.so.logger.LoggingAnchor;
import org.onap.so.adapters.sdnc.SDNCAdapterPortType;
import org.onap.so.adapters.sdnc.SDNCAdapterRequest;
import org.onap.so.adapters.sdnc.SDNCAdapterResponse;
import org.onap.logging.filter.base.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
// BPEL SDNCAdapter SOAP Web Service implementation
@WebService(serviceName = "SDNCAdapterService", endpointInterface = "org.onap.so.adapters.sdnc.SDNCAdapterPortType",
targetNamespace = "http://org.onap/workflow/sdnc/adapter/wsdl/v1")
@Component
public class SDNCAdapterPortTypeImpl implements SDNCAdapterPortType {
private static Logger logger = LoggerFactory.getLogger(SDNCAdapterPortTypeImpl.class);
@Autowired
private SDNCRestClient sdncClient;
@PostConstruct
public void init() {
logger.info(LoggingAnchor.THREE, MessageEnum.RA_INIT_SDNC_ADAPTER.toString(), "SDNC", "SDNCAdapterPortType");
}
/**
* Health Check web method. Does nothing but return to show the adapter is deployed.
*/
@Override
public void healthCheck() {
logger.debug("Health check call in SDNC Adapter");
}
@Override
public SDNCAdapterResponse sdncAdapter(SDNCAdapterRequest bpelRequest) {
String bpelReqId = bpelRequest.getRequestHeader().getRequestId();
String callbackUrl = bpelRequest.getRequestHeader().getCallbackUrl();
try {
sdncClient.executeRequest(bpelRequest);
} catch (Exception e) {
String respMsg = "Error sending request to SDNC. Failed to start SDNC Client thread " + e.getMessage();
logger.error(LoggingAnchor.FOUR, MessageEnum.RA_SEND_REQUEST_SDNC_ERR.toString(), "SDNC",
ErrorCode.DataError.getValue(), respMsg, e);
SDNCResponse sdncResp = new SDNCResponse(bpelReqId);
sdncResp.setRespCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
sdncResp.setRespMsg(respMsg);
sdncClient.sendRespToBpel(callbackUrl, sdncResp);
}
return (new SDNCAdapterResponse());
}
}
| 3,528 | 0.65051 | 0.646259 | 85 | 40.505882 | 32.979717 | 117 | false | false | 0 | 0 | 0 | 0 | 81 | 0.068878 | 0.517647 | false | false | 7 |
c5d5540e0017af2eac1052cc13dde13d26dcea7e | 36,395,552,868,843 | a3a601eb120fdb8e0ddc0f6bbc67e75b4042f62a | /app/src/main/java/com/example/goals/a40ui/myViewPager/HuPagerAdapter.java | 1266d6c5974d91ec0748f40fb0175e2e63b17e25 | [] | no_license | hudawei996/com.example.goals.a40ui | https://github.com/hudawei996/com.example.goals.a40ui | c31389753706daae582e81679b15aa010c4905f6 | dac9c338cab380da8b7f8fc38aea55c580b3e7e7 | refs/heads/master | 2022-07-10T22:48:03.481000 | 2017-06-16T08:31:33 | 2017-06-16T08:31:33 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.goals.a40ui.myViewPager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
/**
* Created by huyongqiang on 17/6/8.
*/
public class HuPagerAdapter extends FragmentPagerAdapter {
//public class HuPagerAdapter extends PagerAdapter {
/*protected List<View> views;
public HuPagerAdapter(List<View> viewList) {
views = viewList;
}
@Override
public int getCount() {
return views.size();
}
@Override
public boolean isViewFromObject(View view, Object o) {
return view == o;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(views.get(position));
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
container.addView(views.get(position));
return views.get(position);
}*/
private final List<Fragment> mFragments = new ArrayList<>();
private final List<String> mFragmentTitles = new ArrayList<>();
public HuPagerAdapter(FragmentManager fm) {
super(fm);
}
public void addFragment(Fragment fragment, String title) {
mFragments.add(fragment);
mFragmentTitles.add(title);
}
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitles.get(position);
}
}
| UTF-8 | Java | 1,787 | java | HuPagerAdapter.java | Java | [
{
"context": "rayList;\nimport java.util.List;\n\n/**\n * Created by huyongqiang on 17/6/8.\n */\npublic class HuPagerAdapter extend",
"end": 369,
"score": 0.9993815422058105,
"start": 358,
"tag": "USERNAME",
"value": "huyongqiang"
}
] | null | [] | package com.example.goals.a40ui.myViewPager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
/**
* Created by huyongqiang on 17/6/8.
*/
public class HuPagerAdapter extends FragmentPagerAdapter {
//public class HuPagerAdapter extends PagerAdapter {
/*protected List<View> views;
public HuPagerAdapter(List<View> viewList) {
views = viewList;
}
@Override
public int getCount() {
return views.size();
}
@Override
public boolean isViewFromObject(View view, Object o) {
return view == o;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(views.get(position));
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
container.addView(views.get(position));
return views.get(position);
}*/
private final List<Fragment> mFragments = new ArrayList<>();
private final List<String> mFragmentTitles = new ArrayList<>();
public HuPagerAdapter(FragmentManager fm) {
super(fm);
}
public void addFragment(Fragment fragment, String title) {
mFragments.add(fragment);
mFragmentTitles.add(title);
}
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitles.get(position);
}
}
| 1,787 | 0.685506 | 0.67991 | 72 | 23.819445 | 21.954704 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.402778 | false | false | 7 |
efa9b05124841b7c2abfbc8c5ecba3706ee02b17 | 17,145,509,511,540 | b6ea8d21da6ac011f53d1643b7c0914c06bb0518 | /SEPT2021_MajorProject/BackEnd/bookmicroservices/src/main/java/com/rmit/sept/bk_bookservices/bookmicroservices/BookmicroservicesApplication.java | 6cc53b22e7a5c5312fb8db1b47bb18109fcfc837 | [] | no_license | vi-ca/A-Slight-Sep-Up | https://github.com/vi-ca/A-Slight-Sep-Up | 8a1fdcd4b4f19cc8e47b6ccd0e234d67ec4ab059 | 214ba88db3854078757d6e9e3c10e4c2c85b7a03 | refs/heads/main | 2023-09-01T07:28:41.442000 | 2021-10-27T02:11:50 | 2021-10-27T02:11:50 | 388,715,717 | 0 | 0 | null | false | 2021-09-20T08:46:29 | 2021-07-23T07:29:33 | 2021-09-17T22:10:40 | 2021-09-20T08:46:28 | 108,011 | 0 | 0 | 0 | null | false | false | package com.rmit.sept.bk_bookservices.bookmicroservices;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class BookmicroservicesApplication {
public static void main(String[] args) {
SpringApplication.run(BookmicroservicesApplication.class, args);
}
}
| UTF-8 | Java | 362 | java | BookmicroservicesApplication.java | Java | [] | null | [] | package com.rmit.sept.bk_bookservices.bookmicroservices;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class BookmicroservicesApplication {
public static void main(String[] args) {
SpringApplication.run(BookmicroservicesApplication.class, args);
}
}
| 362 | 0.837017 | 0.837017 | 13 | 26.846153 | 26.697294 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false | 7 |
2b11d8fb6a74c291259d8da29289e125c86bb532 | 33,517,924,836,757 | ac07788cd19b259161cfb6594b2cbbe6ea2ec7ce | /app/src/main/java/sriparna/hillhouse/com/notesapp/interfaces/NotesDataFetcher.java | 4750429016dfbc50ec44c65a2dfdf63c9bbbb445 | [] | no_license | sriparnac35/NotesApp | https://github.com/sriparnac35/NotesApp | 78b07aaefe1f027b2382cd8aac7fc2eb419405ee | 5e5ba5cee27f031f1410da6f7a16e3914321afd0 | refs/heads/master | 2021-01-12T16:17:13.311000 | 2016-10-26T08:12:21 | 2016-10-26T08:12:21 | 71,980,908 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sriparna.hillhouse.com.notesapp.interfaces;
import java.util.List;
import sriparna.hillhouse.com.notesapp.NoteModel;
/**
* Created by sriparna on 26/10/16.
*/
public interface NotesDataFetcher {
//TODO: implement pagination
public List<NoteModel> fetchAllNotes();
}
| UTF-8 | Java | 287 | java | NotesDataFetcher.java | Java | [
{
"context": "llhouse.com.notesapp.NoteModel;\n\n/**\n * Created by sriparna on 26/10/16.\n */\npublic interface NotesDataFetche",
"end": 154,
"score": 0.9996818900108337,
"start": 146,
"tag": "USERNAME",
"value": "sriparna"
}
] | null | [] | package sriparna.hillhouse.com.notesapp.interfaces;
import java.util.List;
import sriparna.hillhouse.com.notesapp.NoteModel;
/**
* Created by sriparna on 26/10/16.
*/
public interface NotesDataFetcher {
//TODO: implement pagination
public List<NoteModel> fetchAllNotes();
}
| 287 | 0.756098 | 0.735192 | 13 | 21.076923 | 19.715132 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 7 |
ec17740162fa3b0467d41b7c13a9d433d1938be3 | 33,930,241,663,466 | 970615511344fd59cdf76a4eb752aea7d0d1ac96 | /TelephonePanel.java | d85a1e274b70229d5f35844846a8085c45d726e0 | [] | no_license | chefakeem/Java | https://github.com/chefakeem/Java | c8faac41a3b9e43fa89893ae3bd5c2e5c6b3b682 | 66b1dfe4f0594ebf667ffaa5438110f3673bba03 | refs/heads/master | 2020-03-27T14:25:25.621000 | 2018-08-29T22:08:06 | 2018-08-29T22:08:06 | 146,661,536 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | //*******************************************************************************************
// File Name: TelephonePanel.java
// Name: Akeem Wilkins
// Purpose: 1) Lays out a (functionless) GUI like a telephone keypad witha title, and
// 2) Illustrates use of BorderLayout and GridLayout.
//*******************************************************************************************
import java.awt.*;
import javax.swing.*;
public class TelephonePanel extends JPanel
{
public TelephonePanel()
{
//set BorderLayout for this panel
setLayout(new BorderLayout());
//create a JLabel with "Your Telephone" title
JLabel title = new JLabel("Your Telephone");
//add title label to north of this panel
add(title, BorderLayout.NORTH);
//create panel to hold keypad and give it a 4x3 GridLayout
GridLayout layout = new GridLayout(4, 3);
//add buttons representing keys to key panel
JPanel p1 = new JPanel(layout);
JButton b1 = new JButton("1");
JButton b2 = new JButton("2");
JButton b3 = new JButton("3");
JButton b4 = new JButton("4");
JButton b5 = new JButton("5");
JButton b6 = new JButton("6");
JButton b7 = new JButton("7");
JButton b8 = new JButton("8");
JButton b9 = new JButton("9");
JButton b10 = new JButton("*");
JButton b11 = new JButton("0");
JButton b12 = new JButton("#");
p1.add(b1);
p1.add(b2);
p1.add(b3);
p1.add(b4);
p1.add(b5);
p1.add(b6);
p1.add(b7);
p1.add(b8);
p1.add(b9);
p1.add(b10);
p1.add(b11);
p1.add(b12);
//add key panel to center of this panel
add(p1, BorderLayout.CENTER);
}
} | UTF-8 | Java | 1,841 | java | TelephonePanel.java | Java | [
{
"context": "*****\r\n// File Name: TelephonePanel.java\r\n// Name: Akeem Wilkins\r\n// Purpose: 1) Lays out a (functionless) GUI lik",
"end": 152,
"score": 0.9995434284210205,
"start": 139,
"tag": "NAME",
"value": "Akeem Wilkins"
}
] | null | [] | //*******************************************************************************************
// File Name: TelephonePanel.java
// Name: <NAME>
// Purpose: 1) Lays out a (functionless) GUI like a telephone keypad witha title, and
// 2) Illustrates use of BorderLayout and GridLayout.
//*******************************************************************************************
import java.awt.*;
import javax.swing.*;
public class TelephonePanel extends JPanel
{
public TelephonePanel()
{
//set BorderLayout for this panel
setLayout(new BorderLayout());
//create a JLabel with "Your Telephone" title
JLabel title = new JLabel("Your Telephone");
//add title label to north of this panel
add(title, BorderLayout.NORTH);
//create panel to hold keypad and give it a 4x3 GridLayout
GridLayout layout = new GridLayout(4, 3);
//add buttons representing keys to key panel
JPanel p1 = new JPanel(layout);
JButton b1 = new JButton("1");
JButton b2 = new JButton("2");
JButton b3 = new JButton("3");
JButton b4 = new JButton("4");
JButton b5 = new JButton("5");
JButton b6 = new JButton("6");
JButton b7 = new JButton("7");
JButton b8 = new JButton("8");
JButton b9 = new JButton("9");
JButton b10 = new JButton("*");
JButton b11 = new JButton("0");
JButton b12 = new JButton("#");
p1.add(b1);
p1.add(b2);
p1.add(b3);
p1.add(b4);
p1.add(b5);
p1.add(b6);
p1.add(b7);
p1.add(b8);
p1.add(b9);
p1.add(b10);
p1.add(b11);
p1.add(b12);
//add key panel to center of this panel
add(p1, BorderLayout.CENTER);
}
} | 1,834 | 0.503531 | 0.47094 | 59 | 29.237288 | 21.529907 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.610169 | false | false | 7 |
66078037ecf6fc36c5884af7c966fa63e54cde81 | 21,912,923,188,023 | 7b18b69f44a99975f57dacd3c9a840e58e073fa4 | /app/src/main/java/com/evolve/evolve/EvolveActivities/EvolveAdapters/QuickListAdapter.java | b4e22da940688af8b1f2aaa39f023b3bd0edf696 | [] | no_license | shubhomoy/EvolveAndroid | https://github.com/shubhomoy/EvolveAndroid | a7ae6ef904175f7aeb93ac7f16bbbea8736376c4 | 4a03f60e95fff7a7f5eeb785fee304e59c9420b0 | refs/heads/master | 2016-09-15T15:47:13.422000 | 2016-04-03T17:00:26 | 2016-04-03T17:00:26 | 42,495,292 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.evolve.evolve.EvolveActivities.EvolveAdapters;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.evolve.evolve.EvolveActivities.DoctorSearchActivity;
import com.evolve.evolve.EvolveActivities.SchoolFilterActivity;
import com.evolve.evolve.R;
import java.util.ArrayList;
/**
* Created by vellapanti on 2/12/15.
*/
public class QuickListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private LayoutInflater inflater;
Context context;
ArrayList<String> helpList;
private static final int[] icons = {R.mipmap.ic_local_hospital_black_24dp,
R.mipmap.ic_school_black_24dp};
public QuickListAdapter(Context context, ArrayList<String> helpList) {
this.context = context;
this.helpList = helpList;
inflater = LayoutInflater.from(context);
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
view = inflater.inflate(R.layout.custom_quicklistview, parent, false);
QuickListViewHolder quickListViewHolder = new QuickListViewHolder(view);
return quickListViewHolder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
QuickListViewHolder viewHolder = (QuickListViewHolder) holder;
viewHolder.quicklist.setText(helpList.get(position).toString());
viewHolder.itemLogo.setImageResource(icons[position]);
viewHolder.cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (position) {
case 0:
Intent doctorIntent = new Intent(context, DoctorSearchActivity.class);
context.startActivity(doctorIntent);
break;
case 1:
Intent schoolIntent = new Intent(context, SchoolFilterActivity.class);
context.startActivity(schoolIntent);
break;
}
}
});
}
@Override
public int getItemCount() {
return helpList.size();
}
class QuickListViewHolder extends RecyclerView.ViewHolder {
private TextView quicklist;
private ImageView itemLogo;
private CardView cardView;
public QuickListViewHolder(View itemView) {
super(itemView);
quicklist = (TextView) itemView.findViewById(R.id.quicklist_item);
itemLogo = (ImageView) itemView.findViewById(R.id.item_logo);
cardView = (CardView) itemView.findViewById(R.id.card_root);
}
}
}
| UTF-8 | Java | 2,974 | java | QuickListAdapter.java | Java | [
{
"context": "R;\n\nimport java.util.ArrayList;\n\n/**\n * Created by vellapanti on 2/12/15.\n */\npublic class QuickListAdapter ext",
"end": 586,
"score": 0.9996520280838013,
"start": 576,
"tag": "USERNAME",
"value": "vellapanti"
}
] | null | [] | package com.evolve.evolve.EvolveActivities.EvolveAdapters;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.evolve.evolve.EvolveActivities.DoctorSearchActivity;
import com.evolve.evolve.EvolveActivities.SchoolFilterActivity;
import com.evolve.evolve.R;
import java.util.ArrayList;
/**
* Created by vellapanti on 2/12/15.
*/
public class QuickListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private LayoutInflater inflater;
Context context;
ArrayList<String> helpList;
private static final int[] icons = {R.mipmap.ic_local_hospital_black_24dp,
R.mipmap.ic_school_black_24dp};
public QuickListAdapter(Context context, ArrayList<String> helpList) {
this.context = context;
this.helpList = helpList;
inflater = LayoutInflater.from(context);
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
view = inflater.inflate(R.layout.custom_quicklistview, parent, false);
QuickListViewHolder quickListViewHolder = new QuickListViewHolder(view);
return quickListViewHolder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
QuickListViewHolder viewHolder = (QuickListViewHolder) holder;
viewHolder.quicklist.setText(helpList.get(position).toString());
viewHolder.itemLogo.setImageResource(icons[position]);
viewHolder.cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (position) {
case 0:
Intent doctorIntent = new Intent(context, DoctorSearchActivity.class);
context.startActivity(doctorIntent);
break;
case 1:
Intent schoolIntent = new Intent(context, SchoolFilterActivity.class);
context.startActivity(schoolIntent);
break;
}
}
});
}
@Override
public int getItemCount() {
return helpList.size();
}
class QuickListViewHolder extends RecyclerView.ViewHolder {
private TextView quicklist;
private ImageView itemLogo;
private CardView cardView;
public QuickListViewHolder(View itemView) {
super(itemView);
quicklist = (TextView) itemView.findViewById(R.id.quicklist_item);
itemLogo = (ImageView) itemView.findViewById(R.id.item_logo);
cardView = (CardView) itemView.findViewById(R.id.card_root);
}
}
}
| 2,974 | 0.668796 | 0.664425 | 85 | 33.988235 | 27.611376 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 7 |
18beff4470829a595662dd2edf036b6dd32e848a | 8,306,466,809,167 | 32e81d21bd0c3c19dec69f49c6335f0570c53e7b | /Projekt_1_zGUI/src/Projekt_1/Osoba.java | fd8f8c328b3dbed94ee036483c192aa785de1589 | [] | no_license | s16449/Magazyn | https://github.com/s16449/Magazyn | 92df708c4ce0010e7041dc00c96bb8a944cd3a50 | d0f85eb2e1906b3a935decb429d604fc223c6a3d | refs/heads/master | 2022-04-17T00:45:41.478000 | 2020-04-14T11:33:24 | 2020-04-14T11:33:24 | 255,591,392 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Projekt_1;
public class Osoba {
String imie, nazwisko, adresZamieszkania, dataUrodzenia, dataPierwszegoNajmu, pesel;
public Osoba(String imie, String nazwisko, String pesel, String adresZamieszkania, String dataUrodzenia,
String dataPierwszegoNajmu) {
this.imie = imie;
this.nazwisko = nazwisko;
this.pesel = pesel;
this.adresZamieszkania = adresZamieszkania;
this.dataUrodzenia = dataUrodzenia;
this.dataPierwszegoNajmu = dataPierwszegoNajmu;
}
public String toString() {
return "\nDane osoby:\nImie: " + imie + "\nNazwisko: " + nazwisko + "\nNr pesel: " + pesel
+ "\nAdres zamieszkania: " + adresZamieszkania + "\nData urodzenia: " + dataUrodzenia;
}
public String getImie() {
return imie;
}
public String getPesel() {
return pesel;
}
} | UTF-8 | Java | 786 | java | Osoba.java | Java | [] | null | [] | package Projekt_1;
public class Osoba {
String imie, nazwisko, adresZamieszkania, dataUrodzenia, dataPierwszegoNajmu, pesel;
public Osoba(String imie, String nazwisko, String pesel, String adresZamieszkania, String dataUrodzenia,
String dataPierwszegoNajmu) {
this.imie = imie;
this.nazwisko = nazwisko;
this.pesel = pesel;
this.adresZamieszkania = adresZamieszkania;
this.dataUrodzenia = dataUrodzenia;
this.dataPierwszegoNajmu = dataPierwszegoNajmu;
}
public String toString() {
return "\nDane osoby:\nImie: " + imie + "\nNazwisko: " + nazwisko + "\nNr pesel: " + pesel
+ "\nAdres zamieszkania: " + adresZamieszkania + "\nData urodzenia: " + dataUrodzenia;
}
public String getImie() {
return imie;
}
public String getPesel() {
return pesel;
}
} | 786 | 0.723919 | 0.722646 | 29 | 26.137932 | 30.312992 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.896552 | false | false | 7 |
3fa328d208bcb1552051aaf59dec203eeb32977a | 7,584,912,294,718 | f522460162f4c2581946fd12f65452ab8b9bba3a | /GameCentre/MineSweeper/MineSweeperBoard.java | 73454aa0fcdfefff1f8c808f42f99fcce5a493d0 | [] | no_license | alexzquach/GameCentre | https://github.com/alexzquach/GameCentre | 4dea2028633b5ad2af038d284a0d5808a7efe104 | 89ccd3d989f6d41c1290728d23a1e14b16c27e46 | refs/heads/master | 2020-04-17T04:55:57.729000 | 2019-01-17T16:05:53 | 2019-01-17T16:05:53 | 166,253,579 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package fall2018.csc2017.GameCentre.MineSweeper;
import android.support.annotation.NonNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Observable;
/**
* The sliding tiles board.
* -1: already opened has a bomb
* 0-8: already opened - number of bombs
*/
public class MineSweeperBoard extends Observable implements Iterable<MineSweeperTile>, Serializable {
/**
* The number of rows and columns
*/
private static int numRows;
private static int numCols;
/**
* The rate of bombs.
*/
private static final double bombRatio = 0.1;
/**
* The boolean expression of game state, true if the player lost false otherwise.
*/
private boolean isLost;
/**
* The number of bombs on the board, 15% of the board.
*/
private static int numBombs;
/**
* The tiles on the board in row-major order.
*/
private MineSweeperTile[][] tiles = new MineSweeperTile[numRows][numCols];
/**
* A new board of tiles in row-major order.
* Precondition: len(tiles) == numRows * numCols
*
* @param tiles the tiles for the board
*/
public MineSweeperBoard(List<MineSweeperTile> tiles) {
Iterator<MineSweeperTile> iter = tiles.iterator();
isLost = false;
numBombs = (int) (numRows * numCols * bombRatio);
for (int row = 0; row != numRows; row++) {
for (int col = 0; col != numCols; col++) {
this.tiles[row][col] = iter.next();
}
}
setChanged();
notifyObservers();
}
/**
* Getter for the number of rows
*
* @return Returns the number of rows
*/
public static int getNumRows() {
return numRows;
}
/**
* Getter for the number of columns
*
* @return Returns the number of columns
*/
public static int getNumCols() {
return numCols;
}
/**
* Getter for the number of bombs
*
* @return the number of bombs
*/
public static int getNumBombs() {
return numBombs;
}
/**
* Sets the number of rows and columns depending on the number of difficulty
*
* @param diff The difficulty passed in
*/
public static void setDifficulty(int diff) {
numRows = 20 + (diff * 6);
numCols = 12 + (diff * 4);
}
/**
* Set the number of columns then updates the number of bombs.
*
* @param numCols the new number of columns
*/
public static void setNumCols(int numCols) {
MineSweeperBoard.numCols = numCols;
numBombs = (int) (MineSweeperBoard.numCols * numRows * bombRatio);
}
/**
* Set the number of rows then updates the number of bombs.
*
* @param numRows the new number of rows
*/
public static void setNumRows(int numRows) {
MineSweeperBoard.numRows = numRows;
numBombs = (int) (numCols * MineSweeperBoard.numRows * bombRatio);
}
/**
* Returns a list representation of tiles. In row major order.
*
* @return Returns a list of MineSweeperTiles.
*/
public List<MineSweeperTile> getTiles() {
List<MineSweeperTile> temp = new ArrayList<>();
for (int row = 0; row != numRows; row++) {
for (int col = 0; col != numCols; col++) {
temp.add(this.tiles[row][col]);
}
}
return temp;
}
/**
* Return the tile at (row, col)
*
* @param row the tile row
* @param col the tile column
* @return the tile at (row, col)
*/
public MineSweeperTile getTile(int row, int col) {
return tiles[row][col];
}
/**
* Opens the tile at row, col, and all tiles adjacent until it opens a numbered tile.
*
* @param row the row position of the tile of interest.
* @param col the col position of the tile of interest.
*/
public void open(int row, int col) {
if (tiles[row][col].isNotOpened()) {
// open the tile, always.
tiles[row][col].setOpened();
tiles[row][col].setBackground(tiles[row][col].getBackgroundValue());
// Is itself a bomb tile, call game over.
if (tiles[row][col].getBackgroundValue() == -1) {
isLost = true;
}
// 0 bomb tile, call on adjacent ones, adjacent are either number or 0, since 0 bombs adjacent.
if (tiles[row][col].getBackgroundValue() == 0) {
// Recursively call on adjacent
List<MineSweeperTile> adjacent =
MineSweeperAdjacencyCheck.getAdjacentTiles(tiles, row, col);
for (MineSweeperTile curTile : adjacent) {
recursivePop(curTile, tiles);
}
}
}
setChanged();
notifyObservers();
}
/**
* This is a recursive helper which keep poping the adjancent tile until some number tile
* has been popped
*
* @param curTile the current tile openning
* @param tiles the list of all tiles
*/
private void recursivePop(MineSweeperTile curTile, MineSweeperTile[][] tiles) {
curTile.setOpened();
curTile.setBackground(curTile.getBackgroundValue());
if (curTile.getBackgroundValue() == 0) {
int row = MineSweeperAdjacencyCheck.getRowAndColFromId(curTile.getId()).get(0);
int col = MineSweeperAdjacencyCheck.getRowAndColFromId(curTile.getId()).get(1);
List<MineSweeperTile> rec_adjacent_tiles =
MineSweeperAdjacencyCheck.getAdjacentTiles(tiles, row, col);
for (MineSweeperTile m : rec_adjacent_tiles) {
if (m.isNotOpened()) {
recursivePop(m, tiles);
}
}
}
}
/**
* Return if the player lose the game.
*
* @return true if the player lose the game false otherwise.
*/
public boolean isLost() {
return isLost;
}
/**
* Return a board iterator
*
* @return returns a new board iterator
*/
@Override
@NonNull
public Iterator<MineSweeperTile> iterator() {
//Return a BoardIterator
return new MineSweeperBoardIterator();
}
/**
* Iterate over tiles in a board
*/
private class MineSweeperBoardIterator implements Iterator<MineSweeperTile> {
//These two variables keep track of rows and columns
int rowTracker = 0;
int colTracker = 0;
/**
* Checks to see if the iterator has a next tile or not
*/
@Override
public boolean hasNext() {
//If rowTracker exceeds the total number of rows, we know we no longer have a next
//because we are doing it by row major order
return rowTracker < numRows;
}
/**
* Returns the next item
*
* @return returns the next tile
*/
@Override
public MineSweeperTile next() {
if (!hasNext()) {
throw new NoSuchElementException(String.format
("End of board [%s .. %s]", 1, numCols * numRows));
}
//Remember the result
MineSweeperTile result = tiles[rowTracker][colTracker];
//Get ready for the next call to next
if (colTracker == numCols - 1) {
rowTracker += 1;
colTracker = 0;
} else {
colTracker += 1;
}
//Return what we remembered
return result;
}
}
}
| UTF-8 | Java | 8,050 | java | MineSweeperBoard.java | Java | [] | null | [] | package fall2018.csc2017.GameCentre.MineSweeper;
import android.support.annotation.NonNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Observable;
/**
* The sliding tiles board.
* -1: already opened has a bomb
* 0-8: already opened - number of bombs
*/
public class MineSweeperBoard extends Observable implements Iterable<MineSweeperTile>, Serializable {
/**
* The number of rows and columns
*/
private static int numRows;
private static int numCols;
/**
* The rate of bombs.
*/
private static final double bombRatio = 0.1;
/**
* The boolean expression of game state, true if the player lost false otherwise.
*/
private boolean isLost;
/**
* The number of bombs on the board, 15% of the board.
*/
private static int numBombs;
/**
* The tiles on the board in row-major order.
*/
private MineSweeperTile[][] tiles = new MineSweeperTile[numRows][numCols];
/**
* A new board of tiles in row-major order.
* Precondition: len(tiles) == numRows * numCols
*
* @param tiles the tiles for the board
*/
public MineSweeperBoard(List<MineSweeperTile> tiles) {
Iterator<MineSweeperTile> iter = tiles.iterator();
isLost = false;
numBombs = (int) (numRows * numCols * bombRatio);
for (int row = 0; row != numRows; row++) {
for (int col = 0; col != numCols; col++) {
this.tiles[row][col] = iter.next();
}
}
setChanged();
notifyObservers();
}
/**
* Getter for the number of rows
*
* @return Returns the number of rows
*/
public static int getNumRows() {
return numRows;
}
/**
* Getter for the number of columns
*
* @return Returns the number of columns
*/
public static int getNumCols() {
return numCols;
}
/**
* Getter for the number of bombs
*
* @return the number of bombs
*/
public static int getNumBombs() {
return numBombs;
}
/**
* Sets the number of rows and columns depending on the number of difficulty
*
* @param diff The difficulty passed in
*/
public static void setDifficulty(int diff) {
numRows = 20 + (diff * 6);
numCols = 12 + (diff * 4);
}
/**
* Set the number of columns then updates the number of bombs.
*
* @param numCols the new number of columns
*/
public static void setNumCols(int numCols) {
MineSweeperBoard.numCols = numCols;
numBombs = (int) (MineSweeperBoard.numCols * numRows * bombRatio);
}
/**
* Set the number of rows then updates the number of bombs.
*
* @param numRows the new number of rows
*/
public static void setNumRows(int numRows) {
MineSweeperBoard.numRows = numRows;
numBombs = (int) (numCols * MineSweeperBoard.numRows * bombRatio);
}
/**
* Returns a list representation of tiles. In row major order.
*
* @return Returns a list of MineSweeperTiles.
*/
public List<MineSweeperTile> getTiles() {
List<MineSweeperTile> temp = new ArrayList<>();
for (int row = 0; row != numRows; row++) {
for (int col = 0; col != numCols; col++) {
temp.add(this.tiles[row][col]);
}
}
return temp;
}
/**
* Return the tile at (row, col)
*
* @param row the tile row
* @param col the tile column
* @return the tile at (row, col)
*/
public MineSweeperTile getTile(int row, int col) {
return tiles[row][col];
}
/**
* Opens the tile at row, col, and all tiles adjacent until it opens a numbered tile.
*
* @param row the row position of the tile of interest.
* @param col the col position of the tile of interest.
*/
public void open(int row, int col) {
if (tiles[row][col].isNotOpened()) {
// open the tile, always.
tiles[row][col].setOpened();
tiles[row][col].setBackground(tiles[row][col].getBackgroundValue());
// Is itself a bomb tile, call game over.
if (tiles[row][col].getBackgroundValue() == -1) {
isLost = true;
}
// 0 bomb tile, call on adjacent ones, adjacent are either number or 0, since 0 bombs adjacent.
if (tiles[row][col].getBackgroundValue() == 0) {
// Recursively call on adjacent
List<MineSweeperTile> adjacent =
MineSweeperAdjacencyCheck.getAdjacentTiles(tiles, row, col);
for (MineSweeperTile curTile : adjacent) {
recursivePop(curTile, tiles);
}
}
}
setChanged();
notifyObservers();
}
/**
* This is a recursive helper which keep poping the adjancent tile until some number tile
* has been popped
*
* @param curTile the current tile openning
* @param tiles the list of all tiles
*/
private void recursivePop(MineSweeperTile curTile, MineSweeperTile[][] tiles) {
curTile.setOpened();
curTile.setBackground(curTile.getBackgroundValue());
if (curTile.getBackgroundValue() == 0) {
int row = MineSweeperAdjacencyCheck.getRowAndColFromId(curTile.getId()).get(0);
int col = MineSweeperAdjacencyCheck.getRowAndColFromId(curTile.getId()).get(1);
List<MineSweeperTile> rec_adjacent_tiles =
MineSweeperAdjacencyCheck.getAdjacentTiles(tiles, row, col);
for (MineSweeperTile m : rec_adjacent_tiles) {
if (m.isNotOpened()) {
recursivePop(m, tiles);
}
}
}
}
/**
* Return if the player lose the game.
*
* @return true if the player lose the game false otherwise.
*/
public boolean isLost() {
return isLost;
}
/**
* Return a board iterator
*
* @return returns a new board iterator
*/
@Override
@NonNull
public Iterator<MineSweeperTile> iterator() {
//Return a BoardIterator
return new MineSweeperBoardIterator();
}
/**
* Iterate over tiles in a board
*/
private class MineSweeperBoardIterator implements Iterator<MineSweeperTile> {
//These two variables keep track of rows and columns
int rowTracker = 0;
int colTracker = 0;
/**
* Checks to see if the iterator has a next tile or not
*/
@Override
public boolean hasNext() {
//If rowTracker exceeds the total number of rows, we know we no longer have a next
//because we are doing it by row major order
return rowTracker < numRows;
}
/**
* Returns the next item
*
* @return returns the next tile
*/
@Override
public MineSweeperTile next() {
if (!hasNext()) {
throw new NoSuchElementException(String.format
("End of board [%s .. %s]", 1, numCols * numRows));
}
//Remember the result
MineSweeperTile result = tiles[rowTracker][colTracker];
//Get ready for the next call to next
if (colTracker == numCols - 1) {
rowTracker += 1;
colTracker = 0;
} else {
colTracker += 1;
}
//Return what we remembered
return result;
}
}
}
| 8,050 | 0.549814 | 0.544845 | 264 | 28.477272 | 24.706602 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.337121 | false | false | 7 |
1a097d891baf7f151313162f7cd6b03ff44ef6fc | 22,058,952,084,383 | cfc7c6bf8c6ce574e45338160908d68ff09c9a69 | /main/DocsPrinter.java | 09429fecbefc5283ec94393d7ea7459dbc1addd1 | [] | no_license | metiu07/juro | https://github.com/metiu07/juro | c1a41de6cbe6fc59f22725ef721d0fb1026839ba | 7033ddebf1e67c6877465ae0790c6452fcffaeda | refs/heads/master | 2016-08-09T19:45:46.425000 | 2015-12-26T00:30:44 | 2015-12-26T00:30:44 | 44,397,809 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mato.main;
import mato.matches.Player;
import mato.matches.Team;
import mato.matches.Team_database;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class DocsPrinter {
public static final String tr = "<tr>";
public static final String td = "<td>";
public static final String etd = "</td>";
public static final String etr = "</tr>";
public static void printTeams() {
StringBuilder html = new StringBuilder();
html.append("<html>");
html.append("<head><meta charset=\"UTF-8\"></head>");
html.append("<h1>SAA PISTA</h1><hr>");
html.append("<h1>CUP 2015</h1><hr>");
html.append("<table border=2>");
html.append(tr + td + "Cislo timu" + etd + td + "Nazov timu" + etd + td + "Nazov hraca" + etd + etr);
for (Team t : Team_database.getTeamList()) {
html.append(tr + td + t.getUUID() + etd + td + t.getName() + etd + td + etd + etr);
for (Player p : t.getPlayers()) {
html.append(tr + td + etd + td + etd + td + p.getName() + etd + etr);
}
}
html.append("</table>");
html.append("</html>");
//Writing to file
Path p = Paths.get("supiska.html");
try (BufferedWriter writer = Files.newBufferedWriter(p)) {
writer.write(html.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
public static void printProps() {
StringBuilder html = new StringBuilder();
html.append("<html>");
html.append("<head><meta charset=\"UTF-8\"></head>");
html.append("<h1>SAA PISTA</h1><hr>");
html.append("<h1>CUP 2015</h1><hr>");
html.append("<table border=2>");
html.append("</table>");
html.append("</html>");
//Writing to file
Path p = Paths.get("supiska.html");
try (BufferedWriter writer = Files.newBufferedWriter(p)) {
writer.write(html.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 2,182 | java | DocsPrinter.java | Java | [] | null | [] | package mato.main;
import mato.matches.Player;
import mato.matches.Team;
import mato.matches.Team_database;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class DocsPrinter {
public static final String tr = "<tr>";
public static final String td = "<td>";
public static final String etd = "</td>";
public static final String etr = "</tr>";
public static void printTeams() {
StringBuilder html = new StringBuilder();
html.append("<html>");
html.append("<head><meta charset=\"UTF-8\"></head>");
html.append("<h1>SAA PISTA</h1><hr>");
html.append("<h1>CUP 2015</h1><hr>");
html.append("<table border=2>");
html.append(tr + td + "Cislo timu" + etd + td + "Nazov timu" + etd + td + "Nazov hraca" + etd + etr);
for (Team t : Team_database.getTeamList()) {
html.append(tr + td + t.getUUID() + etd + td + t.getName() + etd + td + etd + etr);
for (Player p : t.getPlayers()) {
html.append(tr + td + etd + td + etd + td + p.getName() + etd + etr);
}
}
html.append("</table>");
html.append("</html>");
//Writing to file
Path p = Paths.get("supiska.html");
try (BufferedWriter writer = Files.newBufferedWriter(p)) {
writer.write(html.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
public static void printProps() {
StringBuilder html = new StringBuilder();
html.append("<html>");
html.append("<head><meta charset=\"UTF-8\"></head>");
html.append("<h1>SAA PISTA</h1><hr>");
html.append("<h1>CUP 2015</h1><hr>");
html.append("<table border=2>");
html.append("</table>");
html.append("</html>");
//Writing to file
Path p = Paths.get("supiska.html");
try (BufferedWriter writer = Files.newBufferedWriter(p)) {
writer.write(html.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
| 2,182 | 0.55637 | 0.547204 | 78 | 26.97436 | 24.082644 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.487179 | false | false | 7 |
2255f441ceeafd22fccc901ff5d250ad697acd7a | 19,928,648,292,356 | dbf8a5d2a09a69b337a1357d2a148f43bdcdf0b6 | /src/main/java/com/concentrate/search/cache/redis/RedisHolder.java | 231cf19b2f16f9bfff9588a92121a44daaeb42ff | [] | no_license | yancheng3721/cache | https://github.com/yancheng3721/cache | 71a7252101b824882cf064523307d8916e93b2be | 37a64902873952646c73395514635bedee60c95f | refs/heads/master | 2020-12-30T16:15:33.366000 | 2018-01-03T16:50:59 | 2018-01-03T16:50:59 | 90,973,634 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.concentrate.search.cache.redis;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisShardInfo;
import redis.clients.jedis.ShardedJedisPool;
import com.concentrate.search.cache.CacheHolder;
import com.concentrate.search.cache.config.Constants;
import com.concentrate.search.cache.redis.xml.RedisBean;
import com.concentrate.search.cache.redis.xml.XMLConfigParser;
public abstract class RedisHolder<K,V> extends CacheHolder<K,V> {
//REDIS组定义
private Map<String, ShardedJedisPool> shardPoolMap = new HashMap<String, ShardedJedisPool>(); // 连接池的资源map
//功能点,使用哪一组REDIS
private Map<String,String> groupConfig = new HashMap<String,String>();
public void initial() {
XMLConfigParser xmlPaser = new XMLConfigParser();
Map<String, List<RedisBean>> map = xmlPaser.getRedisBean(Constants.REDIS_CONFIG_FILEPATH);
Set<String> keySet = map.keySet();
Iterator<String> iter = keySet.iterator();
Map<String, ShardedJedisPool> tempShardedPoolMap = new HashMap<String, ShardedJedisPool>();
while (iter.hasNext()) {
String mapKey = iter.next();
List<RedisBean> redisList = map.get(mapKey);
List<JedisShardInfo> list = new LinkedList<JedisShardInfo>();
for (int size = 0; size < redisList.size(); size++) {
RedisBean bean = redisList.get(size);
if (bean.isIsable()) {
JedisShardInfo jedisShardInfo = new JedisShardInfo(bean.getRedisIp(), bean.getPort(), bean.getTimeout());
list.add(jedisShardInfo);
}
}
ShardedJedisPool shardedPool;
JedisPoolConfig config = new JedisPoolConfig();
// config.setMaxTotal(redisList.get(0).getMaxActive());
config.setMaxIdle(redisList.get(0).getMaxIdle());
config.setMaxWaitMillis(redisList.get(0).getMaxWait());
config.setTestOnBorrow(redisList.get(0).isTestOnBorrow());
shardedPool = new ShardedJedisPool(config, list);
tempShardedPoolMap.put(mapKey, shardedPool);
}
shardPoolMap.clear();
shardPoolMap.putAll(tempShardedPoolMap);
}
private String getRedisGroupByModuleAndFunction(String module,String function){
String redisGroup = this.groupConfig.get(module+"_"+function);
if(redisGroup == null){
redisGroup = Constants.DEFAULT_REDIS_GROUP_NAME;
}
return redisGroup;
}
/**
*
* 功能描述: <br>
* 取得REDIS CLIENT
*
* @param module
* @param function
* @return
* @see [相关类/方法](可选)
* @since [产品/模块版本](可选)
*/
public ShardedJedisPool getShardRedisPool(String module,String function){
return shardPoolMap.get(getRedisGroupByModuleAndFunction(module,function));
}
}
| UTF-8 | Java | 3,145 | java | RedisHolder.java | Java | [] | null | [] | package com.concentrate.search.cache.redis;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisShardInfo;
import redis.clients.jedis.ShardedJedisPool;
import com.concentrate.search.cache.CacheHolder;
import com.concentrate.search.cache.config.Constants;
import com.concentrate.search.cache.redis.xml.RedisBean;
import com.concentrate.search.cache.redis.xml.XMLConfigParser;
public abstract class RedisHolder<K,V> extends CacheHolder<K,V> {
//REDIS组定义
private Map<String, ShardedJedisPool> shardPoolMap = new HashMap<String, ShardedJedisPool>(); // 连接池的资源map
//功能点,使用哪一组REDIS
private Map<String,String> groupConfig = new HashMap<String,String>();
public void initial() {
XMLConfigParser xmlPaser = new XMLConfigParser();
Map<String, List<RedisBean>> map = xmlPaser.getRedisBean(Constants.REDIS_CONFIG_FILEPATH);
Set<String> keySet = map.keySet();
Iterator<String> iter = keySet.iterator();
Map<String, ShardedJedisPool> tempShardedPoolMap = new HashMap<String, ShardedJedisPool>();
while (iter.hasNext()) {
String mapKey = iter.next();
List<RedisBean> redisList = map.get(mapKey);
List<JedisShardInfo> list = new LinkedList<JedisShardInfo>();
for (int size = 0; size < redisList.size(); size++) {
RedisBean bean = redisList.get(size);
if (bean.isIsable()) {
JedisShardInfo jedisShardInfo = new JedisShardInfo(bean.getRedisIp(), bean.getPort(), bean.getTimeout());
list.add(jedisShardInfo);
}
}
ShardedJedisPool shardedPool;
JedisPoolConfig config = new JedisPoolConfig();
// config.setMaxTotal(redisList.get(0).getMaxActive());
config.setMaxIdle(redisList.get(0).getMaxIdle());
config.setMaxWaitMillis(redisList.get(0).getMaxWait());
config.setTestOnBorrow(redisList.get(0).isTestOnBorrow());
shardedPool = new ShardedJedisPool(config, list);
tempShardedPoolMap.put(mapKey, shardedPool);
}
shardPoolMap.clear();
shardPoolMap.putAll(tempShardedPoolMap);
}
private String getRedisGroupByModuleAndFunction(String module,String function){
String redisGroup = this.groupConfig.get(module+"_"+function);
if(redisGroup == null){
redisGroup = Constants.DEFAULT_REDIS_GROUP_NAME;
}
return redisGroup;
}
/**
*
* 功能描述: <br>
* 取得REDIS CLIENT
*
* @param module
* @param function
* @return
* @see [相关类/方法](可选)
* @since [产品/模块版本](可选)
*/
public ShardedJedisPool getShardRedisPool(String module,String function){
return shardPoolMap.get(getRedisGroupByModuleAndFunction(module,function));
}
}
| 3,145 | 0.652103 | 0.650473 | 88 | 33.852272 | 28.767303 | 125 | true | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.784091 | false | false | 7 |
d57d30341959089d124ee7833a954e3b6975ea63 | 26,336,739,515,415 | 15ebc8955b132a9505824d9dbb6389a7526b7782 | /api/src/main/java/uk/gov/hmcts/fees2/register/api/controllers/advice/FeesControllerAdvice.java | ab18702ce638ec837895ce39639ee29552bff1b7 | [] | no_license | hmcts/ccfr-fees-register-app | https://github.com/hmcts/ccfr-fees-register-app | d90f5896606e6b6d2e17edfb0b7a1e88ebcff5b1 | 1d3fed766ef542f9fbedfdcc0cbce82722e510b4 | refs/heads/master | 2023-08-16T17:20:01.248000 | 2023-08-16T10:26:00 | 2023-08-16T10:26:00 | 113,469,480 | 5 | 6 | null | false | 2023-09-05T14:20:59 | 2017-12-07T15:46:51 | 2022-12-14T22:46:26 | 2023-09-05T14:20:58 | 74,677 | 4 | 4 | 25 | Java | false | false | package uk.gov.hmcts.fees2.register.api.controllers.advice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import uk.gov.hmcts.fees2.register.data.exceptions.BadRequestException;
import uk.gov.hmcts.fees2.register.data.exceptions.ConflictException;
import uk.gov.hmcts.fees2.register.data.exceptions.ReferenceDataNotFoundException;
import uk.gov.hmcts.fees2.register.data.exceptions.TooManyResultsException;
import java.util.Collections;
import java.util.Map;
@RestControllerAdvice
@Order(Ordered.HIGHEST_PRECEDENCE)
public class FeesControllerAdvice {
private static final Logger LOG = LoggerFactory.getLogger(FeesControllerAdvice.class);
private static final String CAUSE = "cause";
@ExceptionHandler({BadRequestException.class})
public ResponseEntity<Map<String,String>> badRequest(BadRequestException e){
LOG.error("Bad request: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, e.getMessage()), HttpStatus.BAD_REQUEST);
}
@ExceptionHandler({ConflictException.class})
public ResponseEntity<Map<String,String>> conflict(ConflictException e){
LOG.error("Conflict: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, e.getMessage()), HttpStatus.CONFLICT);
}
@ExceptionHandler({ReferenceDataNotFoundException.class})
public ResponseEntity<Map<String,String>> referenceDataNotFound(ReferenceDataNotFoundException e){
LOG.error("Reference Data Not Found: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, "\"" + e.getIdValue() + "\" is not a valid value for " + e.getIdName()), HttpStatus.BAD_REQUEST);
}
@ExceptionHandler({TooManyResultsException.class})
public ResponseEntity<Object> tooManyResults(TooManyResultsException e) {
return new ResponseEntity<>(HttpStatus.MULTIPLE_CHOICES);
}
}
| UTF-8 | Java | 2,233 | java | FeesControllerAdvice.java | Java | [] | null | [] | package uk.gov.hmcts.fees2.register.api.controllers.advice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import uk.gov.hmcts.fees2.register.data.exceptions.BadRequestException;
import uk.gov.hmcts.fees2.register.data.exceptions.ConflictException;
import uk.gov.hmcts.fees2.register.data.exceptions.ReferenceDataNotFoundException;
import uk.gov.hmcts.fees2.register.data.exceptions.TooManyResultsException;
import java.util.Collections;
import java.util.Map;
@RestControllerAdvice
@Order(Ordered.HIGHEST_PRECEDENCE)
public class FeesControllerAdvice {
private static final Logger LOG = LoggerFactory.getLogger(FeesControllerAdvice.class);
private static final String CAUSE = "cause";
@ExceptionHandler({BadRequestException.class})
public ResponseEntity<Map<String,String>> badRequest(BadRequestException e){
LOG.error("Bad request: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, e.getMessage()), HttpStatus.BAD_REQUEST);
}
@ExceptionHandler({ConflictException.class})
public ResponseEntity<Map<String,String>> conflict(ConflictException e){
LOG.error("Conflict: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, e.getMessage()), HttpStatus.CONFLICT);
}
@ExceptionHandler({ReferenceDataNotFoundException.class})
public ResponseEntity<Map<String,String>> referenceDataNotFound(ReferenceDataNotFoundException e){
LOG.error("Reference Data Not Found: {}", e.getMessage());
return new ResponseEntity<>(Collections.singletonMap(CAUSE, "\"" + e.getIdValue() + "\" is not a valid value for " + e.getIdName()), HttpStatus.BAD_REQUEST);
}
@ExceptionHandler({TooManyResultsException.class})
public ResponseEntity<Object> tooManyResults(TooManyResultsException e) {
return new ResponseEntity<>(HttpStatus.MULTIPLE_CHOICES);
}
}
| 2,233 | 0.77519 | 0.772056 | 50 | 43.66 | 36.723076 | 165 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.72 | false | false | 7 |
a145009b4541693138bbf6fc8d433a8a9dd55ca4 | 798,863,985,326 | e150e5f1f173f64c1435c4cb1b8fdbece36fcb27 | /client/src/main/java/pl/mwaleria/safecommunicator/client/net/ClientEventDispatcher.java | 974eaf4f0cc37336c9a40ea15213955c3f650cfb | [
"Apache-2.0"
] | permissive | mwaleria/safecommunicator | https://github.com/mwaleria/safecommunicator | 75b2abe455be4d4617b913ab17c9c66212378bab | 96951786fd55792fa2347c035a89ab3f8e54bdeb | refs/heads/master | 2021-01-10T06:54:20.053000 | 2015-10-12T20:22:00 | 2015-10-12T20:22:00 | 43,509,484 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pl.mwaleria.safecommunicator.client.net;
import java.util.Iterator;
import pl.mwaleria.safecommunicator.client.ClientManager;
import pl.mwaleria.safecommunicator.core.Message;
import pl.mwaleria.safecommunicator.core.ServerRequest;
import pl.mwaleria.safecommunicator.core.ServerResponse;
import pl.mwaleria.safecommunicator.core.User;
import pl.mwaleria.safecommunicator.core.net.EventDispatcher;
import pl.mwaleria.safecommunicator.core.net.SafeCommunicatorRunnable;
import pl.mwaleria.safecommunicator.core.wrapper.UserList;
/**
*
* @author mwaleria
*/
public class ClientEventDispatcher extends EventDispatcher<ServerRequest, ServerResponse> {
private final ClientManager clientManager;
public ClientEventDispatcher(ClientManager clientManager) {
super();
this.clientManager = clientManager;
}
@Override
public SafeCommunicatorRunnable<ServerRequest, ServerResponse> createTask(ServerResponse t, Long senderId) {
switch (t.getResponseType()) {
case ALL_USERS:
return fromServerAllUsers(t);
case MESSAGE:
return fromServerMessage(t);
case NEW_USER:
return fromServerNewUser(t);
case USER_LEFT:
return fromServerUSerLeft(t);
case YOUR_USER_ID:
return fromServerMyUserId(t);
default:
break;
}
return null;
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerMyUserId(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
Long userId = (Long) request.getValue();
clientManager.updateUserId(userId);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerUSerLeft(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
User user = (User) request.getValue();
clientManager.deleteUser(user);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerNewUser(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
User user = (User) request.getValue();
clientManager.addNewUser(user);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerMessage(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
Message m = (Message) request.getValue();
clientManager.handleNewMessage(m);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerAllUsers(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
UserList userList = (UserList) request.getValue();
Iterator<User> it = userList.getUsers().iterator();
while (it.hasNext()) {
if (it.next().getId() == clientManager.getCurrentUserId()) {
it.remove();
break;
}
}
clientManager.updateUserList(userList);
return null;
}
};
}
}
| UTF-8 | Java | 3,505 | java | ClientEventDispatcher.java | Java | [
{
"context": "unicator.core.wrapper.UserList;\n\n/**\n *\n * @author mwaleria\n */\npublic class ClientEventDispatcher extends Ev",
"end": 565,
"score": 0.9994862675666809,
"start": 557,
"tag": "USERNAME",
"value": "mwaleria"
}
] | null | [] | package pl.mwaleria.safecommunicator.client.net;
import java.util.Iterator;
import pl.mwaleria.safecommunicator.client.ClientManager;
import pl.mwaleria.safecommunicator.core.Message;
import pl.mwaleria.safecommunicator.core.ServerRequest;
import pl.mwaleria.safecommunicator.core.ServerResponse;
import pl.mwaleria.safecommunicator.core.User;
import pl.mwaleria.safecommunicator.core.net.EventDispatcher;
import pl.mwaleria.safecommunicator.core.net.SafeCommunicatorRunnable;
import pl.mwaleria.safecommunicator.core.wrapper.UserList;
/**
*
* @author mwaleria
*/
public class ClientEventDispatcher extends EventDispatcher<ServerRequest, ServerResponse> {
private final ClientManager clientManager;
public ClientEventDispatcher(ClientManager clientManager) {
super();
this.clientManager = clientManager;
}
@Override
public SafeCommunicatorRunnable<ServerRequest, ServerResponse> createTask(ServerResponse t, Long senderId) {
switch (t.getResponseType()) {
case ALL_USERS:
return fromServerAllUsers(t);
case MESSAGE:
return fromServerMessage(t);
case NEW_USER:
return fromServerNewUser(t);
case USER_LEFT:
return fromServerUSerLeft(t);
case YOUR_USER_ID:
return fromServerMyUserId(t);
default:
break;
}
return null;
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerMyUserId(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
Long userId = (Long) request.getValue();
clientManager.updateUserId(userId);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerUSerLeft(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
User user = (User) request.getValue();
clientManager.deleteUser(user);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerNewUser(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
User user = (User) request.getValue();
clientManager.addNewUser(user);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerMessage(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
Message m = (Message) request.getValue();
clientManager.handleNewMessage(m);
return null;
}
};
}
private SafeCommunicatorRunnable<ServerRequest, ServerResponse> fromServerAllUsers(ServerResponse t) {
return new SafeCommunicatorRunnable<ServerRequest, ServerResponse>(t, clientManager.getOutputStreamHandler()) {
@Override
protected ServerRequest doTask(ServerResponse request) {
UserList userList = (UserList) request.getValue();
Iterator<User> it = userList.getUsers().iterator();
while (it.hasNext()) {
if (it.next().getId() == clientManager.getCurrentUserId()) {
it.remove();
break;
}
}
clientManager.updateUserList(userList);
return null;
}
};
}
}
| 3,505 | 0.768046 | 0.768046 | 109 | 31.155964 | 33.278137 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.53211 | false | false | 7 |
ee0b8ba673e1c52fdb959e7ec869e4192fcf95ed | 35,888,746,750,591 | 63edda1a9955668d543b7f04204fffff2b87c496 | /Constructor.java | 8c3920dd71471ee7e75e597b72b59e9a0543a5e6 | [] | no_license | vladimir1vladimirovich/Lessons_Java | https://github.com/vladimir1vladimirovich/Lessons_Java | 77f67ef2b74bd0c2d934eebbc15ef2d54fa621ea | 0a250e8418e76940e93548d0ee024b87002efba1 | refs/heads/master | 2022-01-29T15:17:49.439000 | 2019-06-28T22:08:11 | 2019-06-28T22:08:11 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | public class Constructor {
public static void main(String args[]) {
Human1 human1 = new Human1(); //при создании этого объекта, вызывается конструктор!
Human1 human2 = new Human1("Vladimir");
}
}
class Human1 {
private String name;
private int age;
public Human1() { //пустой констурктор(по умолчанию); У конструктора нет типа(int, void...)
this.name = "Имя по умолчанию"; //имя совпадает с именем класса, так же с Большой буквы
this.age = 0;
System.out.println("Привет из 1-го конструктора");
}
public Human1(String name) {
System.out.println("Привет из 2-го конструктора");
this.name = name;
}
public Human1(String name, int age) {
System.out.println("Привет из 3-го конструктора");
this.name = name;
this.age = age;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
}
| UTF-8 | Java | 1,263 | java | Constructor.java | Java | [
{
"context": "конструктор!\r\n Human1 human2 = new Human1(\"Vladimir\");\r\n }\r\n}\r\n\r\n\r\nclass Human1 {\r\n private Str",
"end": 213,
"score": 0.9997711181640625,
"start": 205,
"tag": "NAME",
"value": "Vladimir"
},
{
"context": "тора нет типа(int, void...)\r\n ... | null | [] | public class Constructor {
public static void main(String args[]) {
Human1 human1 = new Human1(); //при создании этого объекта, вызывается конструктор!
Human1 human2 = new Human1("Vladimir");
}
}
class Human1 {
private String name;
private int age;
public Human1() { //пустой констурктор(по умолчанию); У конструктора нет типа(int, void...)
this.name = "Имя по умолчанию"; //имя совпадает с именем класса, так же с Большой буквы
this.age = 0;
System.out.println("Привет из 1-го конструктора");
}
public Human1(String name) {
System.out.println("Привет из 2-го конструктора");
this.name = name;
}
public Human1(String name, int age) {
System.out.println("Привет из 3-го конструктора");
this.name = name;
this.age = age;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
}
| 1,263 | 0.571565 | 0.558206 | 34 | 28.705883 | 29.19058 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.558824 | false | false | 7 |
608182ae43454982a59be962add4f50a194efc53 | 35,888,746,748,078 | 09c6899ac74a69bca940d2b5a9d44ba5d7a2c1e4 | /src/main/java/dao/ForumReplyDaoImpl2.java | 523e91f7c77a3a7b33c1bf03309fe8f46c4fe0d9 | [] | no_license | deepthytn/project2 | https://github.com/deepthytn/project2 | cfda2fecc41671185e4e41ad0a8762e4d904f2ae | 9591fbefe06d48b3ed8c90e5160ac195a5471bd9 | refs/heads/master | 2020-09-14T21:17:37.404000 | 2017-03-02T12:12:54 | 2017-03-02T12:12:54 | 67,714,637 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import daoservice.ForumModelDao;
import model.Forum;
import model.ForumModel;
import model.ForumReply;
@Repository
@Transactional
public class ForumReplyDaoImpl2 implements ForumReplyDao1 {
@Autowired
SessionFactory sf;
List<ForumReply> flist;
public ForumReply getRowById(int id){
Session s=sf.openSession();
Transaction trx=s.beginTransaction();
ForumReply p=(ForumReply)s.load(ForumReply.class, id);
trx.commit();
s.close();
return p;
}
public int addForumReply(ForumReply f){
Session s=sf.getCurrentSession();
s.save(f);
return 1;
}
public List<ForumReply> getAllForumReply(){
Session session = sf.getCurrentSession();
Query q =session.createQuery("from ForumReply");
flist =(List<ForumReply>)q.list();
return flist;
}
}
| UTF-8 | Java | 1,177 | java | ForumReplyDaoImpl2.java | Java | [] | null | [] | package dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import daoservice.ForumModelDao;
import model.Forum;
import model.ForumModel;
import model.ForumReply;
@Repository
@Transactional
public class ForumReplyDaoImpl2 implements ForumReplyDao1 {
@Autowired
SessionFactory sf;
List<ForumReply> flist;
public ForumReply getRowById(int id){
Session s=sf.openSession();
Transaction trx=s.beginTransaction();
ForumReply p=(ForumReply)s.load(ForumReply.class, id);
trx.commit();
s.close();
return p;
}
public int addForumReply(ForumReply f){
Session s=sf.getCurrentSession();
s.save(f);
return 1;
}
public List<ForumReply> getAllForumReply(){
Session session = sf.getCurrentSession();
Query q =session.createQuery("from ForumReply");
flist =(List<ForumReply>)q.list();
return flist;
}
}
| 1,177 | 0.73407 | 0.731521 | 52 | 21.634615 | 19.008125 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.538462 | false | false | 7 |
8366af1d911b1f7aa78141e192aac7232fa443a3 | 18,133,351,957,824 | aed704ee276d2fe75e590edd9a92925ca9e7e54a | /src/main/java/pattern/decoration/decorationDemo2/ConcreteComponent.java | c6de19ae6d5bfa9357269a715b2b53845261ec1b | [] | no_license | Jassj/Java-Learning | https://github.com/Jassj/Java-Learning | 0ccae54501669a56bbcdd36ba312d04f7994ce28 | fe1f88409d8a89b1bcbe1dc5e64497084614f358 | refs/heads/master | 2022-08-17T14:08:03.859000 | 2021-05-05T23:48:20 | 2021-05-05T23:48:20 | 216,500,356 | 1 | 0 | null | false | 2022-06-17T03:27:34 | 2019-10-21T07:07:43 | 2021-05-05T23:48:35 | 2022-06-17T03:27:34 | 197 | 1 | 0 | 1 | Java | false | false | package pattern.decoration.decorationDemo2;
public class ConcreteComponent extends Component {
@Override
public void operation() {
behavior();
System.out.println("具体的对象操作");
}
private void behavior() {
// 可扩展
System.out.println("我是被装饰的对象");
}
}
| UTF-8 | Java | 337 | java | ConcreteComponent.java | Java | [] | null | [] | package pattern.decoration.decorationDemo2;
public class ConcreteComponent extends Component {
@Override
public void operation() {
behavior();
System.out.println("具体的对象操作");
}
private void behavior() {
// 可扩展
System.out.println("我是被装饰的对象");
}
}
| 337 | 0.621262 | 0.61794 | 16 | 17.8125 | 17.132639 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 7 |
3c077c50317b2673723d40c1340c1edc06d55b80 | 2,362,232,025,503 | 18fca4d2cb62fe8f17fc22d9c6d6c1d739584fd7 | /back/barter/src/main/java/com/barter/mapper/UserMapper.java | d21a7e74e76a0e19660a8ba3e63b44ec408d6d30 | [] | no_license | MistyicCrray/change | https://github.com/MistyicCrray/change | 8f5e9a0c7d738c48dd14c707c13f3393c88f8b10 | d6c059766a01061cf48400088793cce15e0b597d | refs/heads/master | 2022-07-06T21:03:32.657000 | 2019-11-30T07:22:17 | 2019-11-30T07:22:31 | 220,013,217 | 0 | 0 | null | false | 2022-06-29T17:45:43 | 2019-11-06T14:16:30 | 2019-11-30T07:22:50 | 2022-06-29T17:45:40 | 9,378 | 0 | 0 | 4 | JavaScript | false | false | package com.barter.mapper;
import com.barter.model.User;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface UserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Delete({
"delete from t_user",
"where id = #{id,jdbcType=VARCHAR}"
})
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Insert({
"insert into t_user (id, user_name, ",
"password, gender, ",
"img, create_time, ",
"state, address, ",
"phone, login_name, ",
"email, user_type, ",
"active_Code, active_Date, ",
"last_Login_Time)",
"values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ",
"#{password,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, ",
"#{img,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{state,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, ",
"#{phone,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, ",
"#{email,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, ",
"#{activeCode,jdbcType=VARCHAR}, #{activeDate,jdbcType=TIMESTAMP}, ",
"#{lastLoginTime,jdbcType=TIMESTAMP})"
})
int insert(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user",
"where id = #{id,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
List<User> selectAll();
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Update({
"update t_user",
"set user_name = #{userName,jdbcType=VARCHAR},",
"password = #{password,jdbcType=VARCHAR},",
"gender = #{gender,jdbcType=VARCHAR},",
"img = #{img,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"state = #{state,jdbcType=VARCHAR},",
"address = #{address,jdbcType=VARCHAR},",
"phone = #{phone,jdbcType=VARCHAR},",
"login_name = #{loginName,jdbcType=VARCHAR},",
"email = #{email,jdbcType=VARCHAR},",
"user_type = #{userType,jdbcType=VARCHAR},",
"active_Code = #{activeCode,jdbcType=VARCHAR},",
"active_Date = #{activeDate,jdbcType=TIMESTAMP},",
"last_Login_Time = #{lastLoginTime,jdbcType=TIMESTAMP}",
"where id = #{id,jdbcType=VARCHAR}"
})
int updateByPrimaryKey(User record);
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user ",
"where login_name = #{loginName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User findByLoginNameAndPassword(User user);
@SelectProvider(method="selectProvider", type = com.barter.model.dyna.UserDynaProvider.class)
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
List<User> findByDymic(Map<String, Object> map);
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user ",
"where login_name = #{loginName,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User selectByLoginName(String loginname);
@UpdateProvider(type = com.barter.model.dyna.UserDynaProvider.class, method = "updateProvider")
void updateDymic(Map<String, Object> map);
} | UTF-8 | Java | 11,663 | java | UserMapper.java | Java | [
{
"context": "R),\r\n @Result(column=\"password\", property=\"password\", jdbcType=JdbcType.VARCHAR),\r\n @Result(co",
"end": 4522,
"score": 0.7220766544342041,
"start": 4514,
"tag": "PASSWORD",
"value": "password"
},
{
"context": " \"update t_user\",\r\n \"s... | null | [] | package com.barter.mapper;
import com.barter.model.User;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface UserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Delete({
"delete from t_user",
"where id = #{id,jdbcType=VARCHAR}"
})
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Insert({
"insert into t_user (id, user_name, ",
"password, gender, ",
"img, create_time, ",
"state, address, ",
"phone, login_name, ",
"email, user_type, ",
"active_Code, active_Date, ",
"last_Login_Time)",
"values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ",
"#{password,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, ",
"#{img,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{state,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, ",
"#{phone,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, ",
"#{email,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, ",
"#{activeCode,jdbcType=VARCHAR}, #{activeDate,jdbcType=TIMESTAMP}, ",
"#{lastLoginTime,jdbcType=TIMESTAMP})"
})
int insert(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user",
"where id = #{id,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="<PASSWORD>", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
List<User> selectAll();
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_user
*
* @mbg.generated Thu Nov 07 00:27:46 CST 2019
*/
@Update({
"update t_user",
"set user_name = #{userName,jdbcType=VARCHAR},",
"password = #{password,jdbcType=VARCHAR},",
"gender = #{gender,jdbcType=VARCHAR},",
"img = #{img,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"state = #{state,jdbcType=VARCHAR},",
"address = #{address,jdbcType=VARCHAR},",
"phone = #{phone,jdbcType=VARCHAR},",
"login_name = #{loginName,jdbcType=VARCHAR},",
"email = #{email,jdbcType=VARCHAR},",
"user_type = #{userType,jdbcType=VARCHAR},",
"active_Code = #{activeCode,jdbcType=VARCHAR},",
"active_Date = #{activeDate,jdbcType=TIMESTAMP},",
"last_Login_Time = #{lastLoginTime,jdbcType=TIMESTAMP}",
"where id = #{id,jdbcType=VARCHAR}"
})
int updateByPrimaryKey(User record);
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user ",
"where login_name = #{loginName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User findByLoginNameAndPassword(User user);
@SelectProvider(method="selectProvider", type = com.barter.model.dyna.UserDynaProvider.class)
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="<PASSWORD>", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
List<User> findByDymic(Map<String, Object> map);
@Select({
"select",
"id, user_name, password, gender, img, create_time, state, address, phone, login_name, ",
"email, user_type, active_Code, active_Date, last_Login_Time",
"from t_user ",
"where login_name = #{loginName,jdbcType=VARCHAR}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="password", property="<PASSWORD>", jdbcType=JdbcType.VARCHAR),
@Result(column="gender", property="gender", jdbcType=JdbcType.VARCHAR),
@Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
@Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Code", property="activeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="active_Date", property="activeDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="last_Login_Time", property="lastLoginTime", jdbcType=JdbcType.TIMESTAMP)
})
User selectByLoginName(String loginname);
@UpdateProvider(type = com.barter.model.dyna.UserDynaProvider.class, method = "updateProvider")
void updateDymic(Map<String, Object> map);
} | 11,669 | 0.649233 | 0.644088 | 222 | 50.545044 | 31.754623 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.954955 | false | false | 7 |
314bd7e2960b92822ef2b843dffdbdb307ba2341 | 25,675,314,557,599 | b0a9d8b88857910196d66a0e5b3ab7de009fa8f6 | /app/src/main/java/com/syncbridge/bestconnections/MyJournalActivity.java | a554197695a1069cb4acef8fd471b7d4437ac821 | [] | no_license | NickHub4017/BestConnections | https://github.com/NickHub4017/BestConnections | 60047c35956d7c893a2d413b0df89239214dc33b | edc398b4014368b9967da9aad323dd4a6c3bec27 | refs/heads/master | 2021-01-10T15:06:29.148000 | 2016-03-31T16:34:58 | 2016-03-31T16:34:58 | 54,828,607 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.syncbridge.bestconnections;
import android.app.LocalActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaPlayer;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;
import Classes.MusicManager;
public class MyJournalActivity extends MainActivity {
String SECTION;
public Context m_context;
MediaPlayer mediaPlayer;
private boolean isPlaying = true;
TabHost tabHost;
LocalActivityManager mlam;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_journal);
m_context = this.getApplicationContext();
SECTION = getIntent().getExtras().getString("SECTION");
activeActivity = 9;
set(MyJournalActivity.this);
mlam = new LocalActivityManager(this, false);
mlam.dispatchCreate(savedInstanceState);
Resources ressources = getResources();
tabHost = (TabHost)findViewById(R.id.tab_host);
tabHost.setup(mlam);
tabHost.addTab(createTab(MyJournalQuotesActivity.class, "Journalling", "JOURNALLING"));
tabHost.addTab(createTab(JournalAnswersActivity.class, "Answers", "ANSWERS"));
tabHost.addTab(createTab(JournalCommentsActivity.class, "Comments", "COMMENTS"));
tabHost.setOnTabChangedListener(tabChangeListener);
setInitialTab();
handleSpeakerIcon();
}
private TabHost.TabSpec createTab(final Class<?> intentClass, final String tag,
final String title)
{
final Intent intent = new Intent().setClass(this, intentClass);
intent.putExtra("SECTION", SECTION);
final View tab = LayoutInflater.from(tabHost.getContext()).
inflate(R.layout.layout_tab, null);
((TextView)tab.findViewById(R.id.tab_text)).setText(title);
return tabHost.newTabSpec(tag).setIndicator(tab).setContent(intent);
}
private void handleSpeakerIcon() {
if (!continueMusic) {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_mute);
} else {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_unmute);
}
((ImageView) findViewById(R.id.imageViewSpeaker)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//mDrawerLayout.closeDrawers();
if (continueMusic) {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_mute);
((ImageView) findViewById(R.id.imageViewSpeaker)).requestLayout();
MusicManager.pause();
continueMusic = false;
} else {
currentActivity = activeActivity;
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_unmute);
((ImageView) findViewById(R.id.imageViewSpeaker)).requestLayout();
MusicManager.start(m_context, getMusic(), true);
continueMusic = true;
}
}
});
}
private void setInitialTab() {
tabHost.setCurrentTab(0);
// Intent i = new Intent(JournalActivity.this, JournalQuotesActivity.class);
// i.putExtra("SECTION", SECTION);
// startActivity(i);
// overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
}
TabHost.OnTabChangeListener tabChangeListener = new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String s) {
int currentTab = tabHost.getCurrentTab();
if(currentTab == 0) {
//security
// Intent i = new Intent(JournalActivity.this, JournalQuotesActivity.class);
// i.putExtra("SECTION", SECTION);
// startActivity(i);
// overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
} else if(currentTab == 1) {
JournalAnswersActivity.reload();
} else if(currentTab == 2) {
JournalCommentsActivity.reload();
}
}
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_global, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
if(id == R.id.action_menu_back) {
this.finish();
}
return super.onOptionsItemSelected(item);
}
}
| UTF-8 | Java | 5,577 | java | MyJournalActivity.java | Java | [] | null | [] | package com.syncbridge.bestconnections;
import android.app.LocalActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaPlayer;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;
import Classes.MusicManager;
public class MyJournalActivity extends MainActivity {
String SECTION;
public Context m_context;
MediaPlayer mediaPlayer;
private boolean isPlaying = true;
TabHost tabHost;
LocalActivityManager mlam;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_journal);
m_context = this.getApplicationContext();
SECTION = getIntent().getExtras().getString("SECTION");
activeActivity = 9;
set(MyJournalActivity.this);
mlam = new LocalActivityManager(this, false);
mlam.dispatchCreate(savedInstanceState);
Resources ressources = getResources();
tabHost = (TabHost)findViewById(R.id.tab_host);
tabHost.setup(mlam);
tabHost.addTab(createTab(MyJournalQuotesActivity.class, "Journalling", "JOURNALLING"));
tabHost.addTab(createTab(JournalAnswersActivity.class, "Answers", "ANSWERS"));
tabHost.addTab(createTab(JournalCommentsActivity.class, "Comments", "COMMENTS"));
tabHost.setOnTabChangedListener(tabChangeListener);
setInitialTab();
handleSpeakerIcon();
}
private TabHost.TabSpec createTab(final Class<?> intentClass, final String tag,
final String title)
{
final Intent intent = new Intent().setClass(this, intentClass);
intent.putExtra("SECTION", SECTION);
final View tab = LayoutInflater.from(tabHost.getContext()).
inflate(R.layout.layout_tab, null);
((TextView)tab.findViewById(R.id.tab_text)).setText(title);
return tabHost.newTabSpec(tag).setIndicator(tab).setContent(intent);
}
private void handleSpeakerIcon() {
if (!continueMusic) {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_mute);
} else {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_unmute);
}
((ImageView) findViewById(R.id.imageViewSpeaker)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//mDrawerLayout.closeDrawers();
if (continueMusic) {
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_mute);
((ImageView) findViewById(R.id.imageViewSpeaker)).requestLayout();
MusicManager.pause();
continueMusic = false;
} else {
currentActivity = activeActivity;
((ImageView) findViewById(R.id.imageViewSpeaker)).setImageResource(R.mipmap.ic_unmute);
((ImageView) findViewById(R.id.imageViewSpeaker)).requestLayout();
MusicManager.start(m_context, getMusic(), true);
continueMusic = true;
}
}
});
}
private void setInitialTab() {
tabHost.setCurrentTab(0);
// Intent i = new Intent(JournalActivity.this, JournalQuotesActivity.class);
// i.putExtra("SECTION", SECTION);
// startActivity(i);
// overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
}
TabHost.OnTabChangeListener tabChangeListener = new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String s) {
int currentTab = tabHost.getCurrentTab();
if(currentTab == 0) {
//security
// Intent i = new Intent(JournalActivity.this, JournalQuotesActivity.class);
// i.putExtra("SECTION", SECTION);
// startActivity(i);
// overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
} else if(currentTab == 1) {
JournalAnswersActivity.reload();
} else if(currentTab == 2) {
JournalCommentsActivity.reload();
}
}
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_global, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
if(id == R.id.action_menu_back) {
this.finish();
}
return super.onOptionsItemSelected(item);
}
}
| 5,577 | 0.615205 | 0.614129 | 155 | 33.980644 | 28.578465 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.63871 | false | false | 7 |
6447840f4528ae318db5226ec1d6d72a326b6f63 | 7,456,063,231,038 | 149c4bee78c7683e9edd5c63d3d50cdf0dac91d5 | /sda-commons-server-key-mgmt/src/main/java/org/sdase/commons/keymgmt/manager/NoKeyKeyManager.java | 923779b37d28c1dbc69ad8804a613373e595a8ac | [
"MIT"
] | permissive | SDA-SE/sda-dropwizard-commons | https://github.com/SDA-SE/sda-dropwizard-commons | 1bb290832a992beaae0c4713ade130d09f4e8571 | 518348615da2b767e5e593b418f8410c5b7e9008 | refs/heads/master | 2023-08-16T05:27:27.481000 | 2023-08-15T07:35:10 | 2023-08-15T08:06:38 | 227,131,980 | 43 | 11 | MIT | false | 2023-09-14T15:09:11 | 2019-12-10T13:48:12 | 2023-09-07T02:36:28 | 2023-09-14T15:09:11 | 5,691 | 36 | 9 | 26 | Java | false | false | package org.sdase.commons.keymgmt.manager;
import java.util.Collections;
import java.util.Set;
/**
* simulates a non existing key. For a non exiting key, there are no valid values and therefore no
* testable can be seen as valid.
*/
public class NoKeyKeyManager implements KeyManager {
@Override
public Set<String> getValidValues() {
return Collections.emptySet();
}
@Override
public boolean isValidValue(String testable) {
return false;
}
}
| UTF-8 | Java | 469 | java | NoKeyKeyManager.java | Java | [] | null | [] | package org.sdase.commons.keymgmt.manager;
import java.util.Collections;
import java.util.Set;
/**
* simulates a non existing key. For a non exiting key, there are no valid values and therefore no
* testable can be seen as valid.
*/
public class NoKeyKeyManager implements KeyManager {
@Override
public Set<String> getValidValues() {
return Collections.emptySet();
}
@Override
public boolean isValidValue(String testable) {
return false;
}
}
| 469 | 0.733476 | 0.733476 | 21 | 21.333334 | 24.33366 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | false | false | 7 |
92d78653c56b74da3059e5a51baea600119d0d17 | 8,787,503,153,312 | 7dff7af496136bc4dff87171062ae9790a9bd15d | /src/com/fumec/util/GaleriaAdapter.java | 5d5b540fb689bb97103c0a0cd36b7289ea876230 | [] | no_license | raffaelps/ondecomer | https://github.com/raffaelps/ondecomer | 0e9b6245bd10dd6178bb8ce376ea2ca137ca34fc | 79c6e670fe4dbfedf082c81a677499cdaeb217c4 | refs/heads/master | 2016-09-06T02:40:51.078000 | 2013-05-07T01:29:07 | 2013-05-07T01:29:07 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.fumec.util;
import com.fumec.ondecomer.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
public class GaleriaAdapter extends BaseAdapter {
private Context contexto;
private Integer[] mImageIds = {
R.drawable.buteco1,
R.drawable.buteco2,
R.drawable.buteco3
};
public GaleriaAdapter(Context c) {
contexto = c;
}
@Override
public int getCount() {
return mImageIds.length;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView i = new ImageView(contexto);
i.setImageResource(mImageIds[position]);
i.setScaleType(ImageView.ScaleType.FIT_XY);
i.setLayoutParams(new Gallery.LayoutParams(136, 88));
return i;
}
}
| UTF-8 | Java | 1,013 | java | GaleriaAdapter.java | Java | [] | null | [] | package com.fumec.util;
import com.fumec.ondecomer.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
public class GaleriaAdapter extends BaseAdapter {
private Context contexto;
private Integer[] mImageIds = {
R.drawable.buteco1,
R.drawable.buteco2,
R.drawable.buteco3
};
public GaleriaAdapter(Context c) {
contexto = c;
}
@Override
public int getCount() {
return mImageIds.length;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView i = new ImageView(contexto);
i.setImageResource(mImageIds[position]);
i.setScaleType(ImageView.ScaleType.FIT_XY);
i.setLayoutParams(new Gallery.LayoutParams(136, 88));
return i;
}
}
| 1,013 | 0.730503 | 0.722606 | 50 | 19.26 | 17.982002 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.16 | false | false | 7 |
2090d2777653cde1e42252ea7d43e38cb8b595f5 | 5,411,658,833,087 | 96a20da8a4275931f47be964cd5972e08266fdc7 | /app/src/test/java/sky/pierry/MovieTest.java | 5f6d969b176cd37d06e254edbbc5d3336eda46a7 | [
"Apache-2.0"
] | permissive | Pierry/sky-test | https://github.com/Pierry/sky-test | a287b83dc34066f20e0f45e12acb36819011d4a5 | fd50525af6484389a5a97a5dfc5d214b945555a2 | refs/heads/master | 2020-03-24T01:28:34.734000 | 2018-07-25T18:18:40 | 2018-07-25T18:18:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sky.pierry;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import sky.pierry.core.domain.Movie;
import sky.pierry.home.presentation.view.custom.HomeAdapter;
@RunWith(MockitoJUnitRunner.class) public class MovieTest {
@Test public void testValid() {
Movie movie = new Movie();
movie.setTitle("Title");
boolean isValid = movie.isValid();
Assert.assertTrue(isValid);
}
@Test public void testInvalid() {
Movie movie = new Movie();
movie.setId(UUID.randomUUID().toString());
boolean isValid = movie.isValid();
Assert.assertFalse(isValid);
}
}
| UTF-8 | Java | 768 | java | MovieTest.java | Java | [] | null | [] | package sky.pierry;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import sky.pierry.core.domain.Movie;
import sky.pierry.home.presentation.view.custom.HomeAdapter;
@RunWith(MockitoJUnitRunner.class) public class MovieTest {
@Test public void testValid() {
Movie movie = new Movie();
movie.setTitle("Title");
boolean isValid = movie.isValid();
Assert.assertTrue(isValid);
}
@Test public void testInvalid() {
Movie movie = new Movie();
movie.setId(UUID.randomUUID().toString());
boolean isValid = movie.isValid();
Assert.assertFalse(isValid);
}
}
| 768 | 0.734375 | 0.734375 | 29 | 25.482759 | 16.717987 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.655172 | false | false | 7 |
2f0b4d38a96f308bc34742f90673dcf21199bc70 | 32,375,463,529,485 | a16c2445de6fbac5e87a15fc040701a89e9947bb | /scriptEngin/src/jmo/com/funshion/gamma/jmo/lang/ast/FalseNode.java | 035fc9ecf96f7c71941580b5d0ca765f8f163644 | [] | no_license | mdxys/commentparse | https://github.com/mdxys/commentparse | 3ec6c7a77fd5750f0b76e62e9dfd505eeccc724f | 7aa5b42273ce977513027b3d16f4e8ec7ca0e958 | refs/heads/master | 2016-08-05T01:46:47.229000 | 2015-04-03T14:02:14 | 2015-04-03T14:02:14 | 16,017,966 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.funshion.gamma.jmo.lang.ast;
import com.funshion.gamma.jmo.lang.Interpreter;
import com.funshion.gamma.jmo.lang.source.SourcePosition;
/**
* The boolean false.
*/
public class FalseNode extends Node {
public FalseNode(SourcePosition pos) {
super(pos);
}
@Override
public Object eval(Interpreter interpreter) {
return Boolean.FALSE;
}
@Override
public String toString() {
return "false";
}
}
| UTF-8 | Java | 466 | java | FalseNode.java | Java | [] | null | [] | package com.funshion.gamma.jmo.lang.ast;
import com.funshion.gamma.jmo.lang.Interpreter;
import com.funshion.gamma.jmo.lang.source.SourcePosition;
/**
* The boolean false.
*/
public class FalseNode extends Node {
public FalseNode(SourcePosition pos) {
super(pos);
}
@Override
public Object eval(Interpreter interpreter) {
return Boolean.FALSE;
}
@Override
public String toString() {
return "false";
}
}
| 466 | 0.667382 | 0.667382 | 24 | 18.416666 | 18.206951 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 7 |
83e453f370390dd2d1ed425158eb626589357ba6 | 32,375,463,531,021 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_cec99733ef59ad1563682a9cc7bb8e2be9f4d4da/PureNominalData/2_cec99733ef59ad1563682a9cc7bb8e2be9f4d4da_PureNominalData_s.java | b209f548800061dcc0d43467e55a363b6dd3018f | [] | no_license | zhongxingyu/Seer | https://github.com/zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516000 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | false | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | 2023-06-21T00:53:27 | 2023-06-22T07:55:57 | 2,849,868 | 2 | 2 | 0 | null | false | false | package com.datascience.core.nominal;
import com.datascience.utils.CostMatrix;
import com.google.common.math.DoubleMath;
import java.util.*;
import static com.google.common.base.Preconditions.checkArgument;
/**
* User: artur
* Date: 4/12/13
*/
public class PureNominalData {
static protected final int MAX_CATEGORY_LENGTH = 100;
protected Collection<String> categories;
protected boolean fixedPriors;
protected Map<String, Double> categoryPriors;
protected CostMatrix<String> costMatrix;
public Collection<String> getCategories(){
return categories;
}
public boolean arePriorsFixed(){
return fixedPriors;
}
public double getCategoryPrior(String name){
return categoryPriors.get(name);
}
public Map<String, Double> getCategoryPriors(){
return categoryPriors;
}
public void setCategoryPriors(Collection<CategoryValue> priors){
double priorSum = 0.;
Set<String> categoryNames = new HashSet<String>();
for (CategoryValue cv : priors){
priorSum += cv.value;
checkArgument(categoryNames.add(cv.categoryName),
"CategoryPriors contains two categories with the same name");
checkArgument(cv.value > 0. && cv.value < 1., "Each category prior should be between 0 and 1");
}
checkArgument(priors.size() == categories.size(),
"Different number of categories in categoryPriors and categories parameters");
checkArgument(DoubleMath.fuzzyEquals(1., priorSum, 1e-6),
"Priors should sum up to 1. or not to be given (therefore we initialize the priors to be uniform across classes)");
fixedPriors = true;
categoryPriors = new HashMap<String, Double>();
for (CategoryValue cv : priors){
checkArgument(categories.contains(cv.categoryName),
"Categories list does not contain category named %s", cv.categoryName);
categoryPriors.put(cv.categoryName, cv.value);
}
}
public CostMatrix<String> getCostMatrix(){
return costMatrix;
}
public void initialize(Collection<String> categories, Collection<CategoryValue> priors, CostMatrix<String> costMatrix){
checkArgument(categories != null, "There is no categories collection");
checkArgument(categories.size() >= 2, "There should be at least two categories");
for (String c : categories){
checkArgument(c.length() < MAX_CATEGORY_LENGTH, "Category names should be shorter than 50 chars");
}
this.categories = new HashSet<String>();
this.categories.addAll(categories);
checkArgument(this.categories.size() == categories.size(), "Category names should be different");
fixedPriors = false;
if (priors != null){
setCategoryPriors(priors);
}
if (costMatrix == null) {
this.costMatrix = new CostMatrix<String>();
}
else {
for (String s : costMatrix.getKnownValues()){
checkArgument(this.categories.contains(s), "Categories list does not contain category named %s", s);
}
this.costMatrix = costMatrix;
}
for (String c1 : categories)
for (String c2 : categories){
if (!this.costMatrix.hasCost(c1, c2))
this.costMatrix.add(c1, c2, c1.equals(c2) ? 0. : 1.);
}
}
public void checkForCategoryExist(String name){
if (!categories.contains(name))
throw new IllegalArgumentException("There is no category named: " + name);
}
}
| UTF-8 | Java | 3,304 | java | 2_cec99733ef59ad1563682a9cc7bb8e2be9f4d4da_PureNominalData_s.java | Java | [
{
"context": "base.Preconditions.checkArgument;\n \n /**\n * User: artur\n * Date: 4/12/13\n */\n public class PureNominalD",
"end": 240,
"score": 0.9924355745315552,
"start": 235,
"tag": "USERNAME",
"value": "artur"
}
] | null | [] | package com.datascience.core.nominal;
import com.datascience.utils.CostMatrix;
import com.google.common.math.DoubleMath;
import java.util.*;
import static com.google.common.base.Preconditions.checkArgument;
/**
* User: artur
* Date: 4/12/13
*/
public class PureNominalData {
static protected final int MAX_CATEGORY_LENGTH = 100;
protected Collection<String> categories;
protected boolean fixedPriors;
protected Map<String, Double> categoryPriors;
protected CostMatrix<String> costMatrix;
public Collection<String> getCategories(){
return categories;
}
public boolean arePriorsFixed(){
return fixedPriors;
}
public double getCategoryPrior(String name){
return categoryPriors.get(name);
}
public Map<String, Double> getCategoryPriors(){
return categoryPriors;
}
public void setCategoryPriors(Collection<CategoryValue> priors){
double priorSum = 0.;
Set<String> categoryNames = new HashSet<String>();
for (CategoryValue cv : priors){
priorSum += cv.value;
checkArgument(categoryNames.add(cv.categoryName),
"CategoryPriors contains two categories with the same name");
checkArgument(cv.value > 0. && cv.value < 1., "Each category prior should be between 0 and 1");
}
checkArgument(priors.size() == categories.size(),
"Different number of categories in categoryPriors and categories parameters");
checkArgument(DoubleMath.fuzzyEquals(1., priorSum, 1e-6),
"Priors should sum up to 1. or not to be given (therefore we initialize the priors to be uniform across classes)");
fixedPriors = true;
categoryPriors = new HashMap<String, Double>();
for (CategoryValue cv : priors){
checkArgument(categories.contains(cv.categoryName),
"Categories list does not contain category named %s", cv.categoryName);
categoryPriors.put(cv.categoryName, cv.value);
}
}
public CostMatrix<String> getCostMatrix(){
return costMatrix;
}
public void initialize(Collection<String> categories, Collection<CategoryValue> priors, CostMatrix<String> costMatrix){
checkArgument(categories != null, "There is no categories collection");
checkArgument(categories.size() >= 2, "There should be at least two categories");
for (String c : categories){
checkArgument(c.length() < MAX_CATEGORY_LENGTH, "Category names should be shorter than 50 chars");
}
this.categories = new HashSet<String>();
this.categories.addAll(categories);
checkArgument(this.categories.size() == categories.size(), "Category names should be different");
fixedPriors = false;
if (priors != null){
setCategoryPriors(priors);
}
if (costMatrix == null) {
this.costMatrix = new CostMatrix<String>();
}
else {
for (String s : costMatrix.getKnownValues()){
checkArgument(this.categories.contains(s), "Categories list does not contain category named %s", s);
}
this.costMatrix = costMatrix;
}
for (String c1 : categories)
for (String c2 : categories){
if (!this.costMatrix.hasCost(c1, c2))
this.costMatrix.add(c1, c2, c1.equals(c2) ? 0. : 1.);
}
}
public void checkForCategoryExist(String name){
if (!categories.contains(name))
throw new IllegalArgumentException("There is no category named: " + name);
}
}
| 3,304 | 0.707324 | 0.698245 | 100 | 32.029999 | 29.888611 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.18 | false | false | 7 |
16404d019fa2c2a72333170c5639873354406736 | 24,180,665,881,911 | 46a6629132f48ec0b25617719b5811967329c304 | /viewer/src/main/java/com/notatracer/common/messaging/trading/LoggingMessageListener.java | 880475f2449efa0ea431323ba7812f128f46afd3 | [] | no_license | mikegggit/stream_viewer | https://github.com/mikegggit/stream_viewer | 93b6649b761b3220811daed4b3ab2040ee340124 | 50f8d2c277403121c2b25839a46dd770693f5444 | refs/heads/master | 2020-04-29T13:06:07.504000 | 2019-05-06T00:32:32 | 2019-05-06T00:32:32 | 176,161,034 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.notatracer.common.messaging.trading;
import com.notatracer.TimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
public class LoggingMessageListener extends DefaultListener {
private static Logger LOGGER = LoggerFactory.getLogger(LoggingMessageListener.class);
private BigDecimal tradePrice;
private BigDecimal strikePrice;
private StringBuilder productStringSB = new StringBuilder();
@Override
public void onTradeMessage(TradeMessage tradeMessage) {
super.onTradeMessage(tradeMessage);
StringBuffer formatString = new StringBuffer("%-20s, id=%d, time=%s, tradeSeqNum=%d, qty=%d, price=%s, product={%s}, BUY: account=%s, SELL: account=%s");
tradePrice = new BigDecimal(new String(tradeMessage.getTradePrice()));
strikePrice = new BigDecimal(new String(tradeMessage.getStrikePrice()));
productStringSB.delete(0, productStringSB.length());
productStringSB
.append(new String(tradeMessage.getSymbol()))
.append(" ")
.append(tradeMessage.getCallPut() == (byte)'C' ? "(C)ALL" : "(P)UT")
.append(" ")
.append(strikePrice)
.append(" ")
.append(new String(tradeMessage.getExpirationDate()))
;
System.out.println(
String.format(
formatString.toString(),
"TradeMessage(" + (char)tradeMessage.getMessageType() + ")",
tradeMessage.getId(),
TimeUtil.formatEpochNanos(tradeMessage.getEpochNanos(), ZoneId.of("America/New_York")),
tradeMessage.getTradeSequenceNumber(),
tradeMessage.getQuantity(),
tradePrice,
productStringSB.toString(),
new String(tradeMessage.getBuyAccount()),
new String(tradeMessage.getSellAccount())));
// System.out.println();
// String timeString = tradeMessage.epochNanos
}
public static void main(String[] args) {
long nanos = 1556734945000000000l;
long epochSeconds = nanos / 1_000_000_000l;
int nanoOfSecond = (int)(nanos % 1_000_000_000);
LocalDateTime localDateTime = LocalDateTime.ofEpochSecond(epochSeconds, nanoOfSecond, ZoneId.of("America/New_York").getRules().getOffset(LocalDateTime.now()));
System.out.println(localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
}
}
| UTF-8 | Java | 2,694 | java | LoggingMessageListener.java | Java | [] | null | [] | package com.notatracer.common.messaging.trading;
import com.notatracer.TimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
public class LoggingMessageListener extends DefaultListener {
private static Logger LOGGER = LoggerFactory.getLogger(LoggingMessageListener.class);
private BigDecimal tradePrice;
private BigDecimal strikePrice;
private StringBuilder productStringSB = new StringBuilder();
@Override
public void onTradeMessage(TradeMessage tradeMessage) {
super.onTradeMessage(tradeMessage);
StringBuffer formatString = new StringBuffer("%-20s, id=%d, time=%s, tradeSeqNum=%d, qty=%d, price=%s, product={%s}, BUY: account=%s, SELL: account=%s");
tradePrice = new BigDecimal(new String(tradeMessage.getTradePrice()));
strikePrice = new BigDecimal(new String(tradeMessage.getStrikePrice()));
productStringSB.delete(0, productStringSB.length());
productStringSB
.append(new String(tradeMessage.getSymbol()))
.append(" ")
.append(tradeMessage.getCallPut() == (byte)'C' ? "(C)ALL" : "(P)UT")
.append(" ")
.append(strikePrice)
.append(" ")
.append(new String(tradeMessage.getExpirationDate()))
;
System.out.println(
String.format(
formatString.toString(),
"TradeMessage(" + (char)tradeMessage.getMessageType() + ")",
tradeMessage.getId(),
TimeUtil.formatEpochNanos(tradeMessage.getEpochNanos(), ZoneId.of("America/New_York")),
tradeMessage.getTradeSequenceNumber(),
tradeMessage.getQuantity(),
tradePrice,
productStringSB.toString(),
new String(tradeMessage.getBuyAccount()),
new String(tradeMessage.getSellAccount())));
// System.out.println();
// String timeString = tradeMessage.epochNanos
}
public static void main(String[] args) {
long nanos = 1556734945000000000l;
long epochSeconds = nanos / 1_000_000_000l;
int nanoOfSecond = (int)(nanos % 1_000_000_000);
LocalDateTime localDateTime = LocalDateTime.ofEpochSecond(epochSeconds, nanoOfSecond, ZoneId.of("America/New_York").getRules().getOffset(LocalDateTime.now()));
System.out.println(localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
}
}
| 2,694 | 0.628062 | 0.61173 | 64 | 41.09375 | 35.385254 | 167 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.71875 | false | false | 7 |
ca54701fa732ed4745206479591c2febb9f0d737 | 2,920,577,786,810 | b3ed59e9005acd1eb069d5a6f08a18627ad22b16 | /sc-f-cp1/eureka-feign/src/main/java/com/echo/eurekafeign/service/impl/HystrixSchedualServiceHiImpl.java | 3675666c2960676f7a19e7989e60371b66fa880b | [] | no_license | Bluebluo/springCloudDemo | https://github.com/Bluebluo/springCloudDemo | 71b31a49f999a481407e722a467c05a18f69fd74 | 5301ea5cd9ed15fc773de121770e02ac7e1d1d2e | refs/heads/master | 2020-04-29T01:36:39.920000 | 2019-03-15T02:44:49 | 2019-03-15T02:44:49 | 175,736,306 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.echo.eurekafeign.service.impl;
import com.echo.eurekafeign.service.SchedualServiceHi;
import org.springframework.stereotype.Component;
@Component
public class HystrixSchedualServiceHiImpl implements SchedualServiceHi {
@Override
public String sayHi(String name) {
return "sorry " + name + " error happened";
}
}
| UTF-8 | Java | 347 | java | HystrixSchedualServiceHiImpl.java | Java | [] | null | [] | package com.echo.eurekafeign.service.impl;
import com.echo.eurekafeign.service.SchedualServiceHi;
import org.springframework.stereotype.Component;
@Component
public class HystrixSchedualServiceHiImpl implements SchedualServiceHi {
@Override
public String sayHi(String name) {
return "sorry " + name + " error happened";
}
}
| 347 | 0.763689 | 0.763689 | 13 | 25.692308 | 24.693146 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 7 |
9551282bb257854f4fd7bbc862e5f962262cad26 | 21,629,455,354,108 | ea013553dc299d58eaa801da4a5dbca2562fdf17 | /app/src/main/java/com/gdd/hangout/util/ContactsUtil.java | fce8c6fc2a27a32b4fe79b49c061376a5b9e53ab | [] | no_license | gddhackathon/hangout_planner | https://github.com/gddhackathon/hangout_planner | 6dc096f1250851f14f56f1de735a9af1d706d2eb | 2c91facc772618e214b098e5facc8434c4623763 | refs/heads/master | 2021-01-10T11:17:58.074000 | 2015-12-03T17:00:00 | 2015-12-03T17:00:00 | 46,767,071 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.gdd.hangout.util;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.provider.ContactsContract;
import com.gdd.hangout.db.ContactDbHelper;
import com.gdd.hangout.model.Contact;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Khatravath on 11/29/2015.
*/
public class ContactsUtil {
public static List<String> displayContacts(ContentResolver contentResolver) {
List<String> contacts = new ArrayList<String>();
ContentResolver cr = contentResolver;
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
null, null, null, null);
if (cur.getCount() > 0) {
while (cur.moveToNext()) {
String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
if (Integer.parseInt(cur.getString(
cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
Cursor pCur = cr.query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",
new String[]{id}, null);
while (pCur.moveToNext()) {
String phoneNo = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
// Toast.makeText(this, "Name: " + name + ", Phone No: " + phoneNo, Toast.LENGTH_SHORT).show();
contacts.add(name + " : " + phoneNo);
}
pCur.close();
}
}
}
return contacts;
}
public static List<String> getContactsForGroup (String groupName, Activity activity){
List<String> contactInfo = new ArrayList<String>();
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
List<Contact> contacts = contactDbHelper.getContacts(groupName);
System.out.println(contacts.toArray().toString());
for(Contact contact : contacts){
System.out.println(contact.getName() + " : " + contact.getPhoneNumber());
contactInfo.add(contact.getName() + " : " + contact.getPhoneNumber());
}
return contactInfo;
}
public static List<String> getAllSavedContacts(Activity activity){
List<String> contactInfo = new ArrayList<String>();
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
List<Contact> contacts = contactDbHelper.getAllSavedContats();
System.out.println(contacts.toArray().toString());
for(Contact contact : contacts){
System.out.println(contact.getName() + " : " + contact.getPhoneNumber() + " : " + contact.getGroupName());
contactInfo.add(contact.getName() + " : " + contact.getPhoneNumber() + " : " + contact.getGroupName());
}
return contactInfo;
}
public static void insertContacts(Activity activity, List<String> selectedContacts, String groupname){
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
System.out.println("selectedContacts = " + selectedContacts);
for(String selectedContact : selectedContacts){
String[] contactName = selectedContact.split(":");
System.out.println("contactName = " + contactName);
contactDbHelper.createContact(contactName[0].trim(), groupname, contactName[1].trim(), "", "", "", "", "", "");
}
}
}
| UTF-8 | Java | 3,807 | java | ContactsUtil.java | Java | [
{
"context": "ist;\r\nimport java.util.List;\r\n\r\n/**\r\n * Created by Khatravath on 11/29/2015.\r\n */\r\npublic class ContactsUtil {\r",
"end": 351,
"score": 0.9896472096443176,
"start": 341,
"tag": "USERNAME",
"value": "Khatravath"
}
] | null | [] | package com.gdd.hangout.util;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.provider.ContactsContract;
import com.gdd.hangout.db.ContactDbHelper;
import com.gdd.hangout.model.Contact;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Khatravath on 11/29/2015.
*/
public class ContactsUtil {
public static List<String> displayContacts(ContentResolver contentResolver) {
List<String> contacts = new ArrayList<String>();
ContentResolver cr = contentResolver;
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
null, null, null, null);
if (cur.getCount() > 0) {
while (cur.moveToNext()) {
String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
if (Integer.parseInt(cur.getString(
cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
Cursor pCur = cr.query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",
new String[]{id}, null);
while (pCur.moveToNext()) {
String phoneNo = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
// Toast.makeText(this, "Name: " + name + ", Phone No: " + phoneNo, Toast.LENGTH_SHORT).show();
contacts.add(name + " : " + phoneNo);
}
pCur.close();
}
}
}
return contacts;
}
public static List<String> getContactsForGroup (String groupName, Activity activity){
List<String> contactInfo = new ArrayList<String>();
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
List<Contact> contacts = contactDbHelper.getContacts(groupName);
System.out.println(contacts.toArray().toString());
for(Contact contact : contacts){
System.out.println(contact.getName() + " : " + contact.getPhoneNumber());
contactInfo.add(contact.getName() + " : " + contact.getPhoneNumber());
}
return contactInfo;
}
public static List<String> getAllSavedContacts(Activity activity){
List<String> contactInfo = new ArrayList<String>();
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
List<Contact> contacts = contactDbHelper.getAllSavedContats();
System.out.println(contacts.toArray().toString());
for(Contact contact : contacts){
System.out.println(contact.getName() + " : " + contact.getPhoneNumber() + " : " + contact.getGroupName());
contactInfo.add(contact.getName() + " : " + contact.getPhoneNumber() + " : " + contact.getGroupName());
}
return contactInfo;
}
public static void insertContacts(Activity activity, List<String> selectedContacts, String groupname){
ContactDbHelper contactDbHelper = new ContactDbHelper(activity);
System.out.println("selectedContacts = " + selectedContacts);
for(String selectedContact : selectedContacts){
String[] contactName = selectedContact.split(":");
System.out.println("contactName = " + contactName);
contactDbHelper.createContact(contactName[0].trim(), groupname, contactName[1].trim(), "", "", "", "", "", "");
}
}
}
| 3,807 | 0.603625 | 0.600473 | 81 | 45 | 34.73391 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.753086 | false | false | 7 |
b5238313f6ac159fdb5fa5ab558c48fb21747c82 | 26,946,624,874,650 | bada814f8dba11ef59093fb6bb69fdf504b16807 | /src/main/java/org/example/hospital/service/DoctorService.java | bad75e2833911c9d8c0699aaa9000c8de848b9a2 | [] | no_license | dmytrorybalskyi/hospital | https://github.com/dmytrorybalskyi/hospital | 20d29dac8a1bdbf2365e305443006c260a892e6e | 3385fe3efc728cce854f1db12b936573a29affa3 | refs/heads/master | 2023-03-10T09:18:09.181000 | 2021-02-27T16:25:35 | 2021-02-27T16:25:35 | 332,528,003 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.example.hospital.service;
import org.example.hospital.DTO.DoctorDTO;
import org.example.hospital.accessingdatamysql.DoctorRepository;
import org.example.hospital.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.sql.SQLException;
import java.util.List;
@Service
public class DoctorService {
@Autowired
private DoctorRepository doctorRepository;
@Autowired
private AccountService accountService;
public List<Doctor> getAllDoctorsByCategory(Category category){
return doctorRepository.findByCategory(category);
}
public List<Doctor> getAllDoctorsByCategoryAndNurse(Category category){
return doctorRepository.findDoctorsByCategoryAndNurse(category.getName(),"nurse");
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {SQLException.class,IllegalArgumentException.class})
public boolean addDoctor(DoctorDTO doctorDTO) {
Account account = convertToAccount(doctorDTO);
Doctor doctor = convertToDoctor(doctorDTO,account);
account.setRole(Roles.doctor);
if(doctor.getCategory().getName().equals("nurse"))
account.setRole(Roles.nurse);
accountService.addAccount(account);
doctorRepository.save(doctor);
return true;
}
private Doctor convertToDoctor(DoctorDTO doctorDTO,Account account) {
return new Doctor.Builder(doctorDTO.getName())
.setCategory(doctorDTO.getCategory())
.setAccount(account).build();
}
private Account convertToAccount(DoctorDTO doctorDTO){
return new Account(doctorDTO.getLogin(),doctorDTO.getPassword());
}
}
| UTF-8 | Java | 1,863 | java | DoctorService.java | Java | [] | null | [] | package org.example.hospital.service;
import org.example.hospital.DTO.DoctorDTO;
import org.example.hospital.accessingdatamysql.DoctorRepository;
import org.example.hospital.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.sql.SQLException;
import java.util.List;
@Service
public class DoctorService {
@Autowired
private DoctorRepository doctorRepository;
@Autowired
private AccountService accountService;
public List<Doctor> getAllDoctorsByCategory(Category category){
return doctorRepository.findByCategory(category);
}
public List<Doctor> getAllDoctorsByCategoryAndNurse(Category category){
return doctorRepository.findDoctorsByCategoryAndNurse(category.getName(),"nurse");
}
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {SQLException.class,IllegalArgumentException.class})
public boolean addDoctor(DoctorDTO doctorDTO) {
Account account = convertToAccount(doctorDTO);
Doctor doctor = convertToDoctor(doctorDTO,account);
account.setRole(Roles.doctor);
if(doctor.getCategory().getName().equals("nurse"))
account.setRole(Roles.nurse);
accountService.addAccount(account);
doctorRepository.save(doctor);
return true;
}
private Doctor convertToDoctor(DoctorDTO doctorDTO,Account account) {
return new Doctor.Builder(doctorDTO.getName())
.setCategory(doctorDTO.getCategory())
.setAccount(account).build();
}
private Account convertToAccount(DoctorDTO doctorDTO){
return new Account(doctorDTO.getLogin(),doctorDTO.getPassword());
}
}
| 1,863 | 0.747182 | 0.747182 | 53 | 34.150944 | 28.888462 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.54717 | false | false | 15 |
1df90094eab2a2403709360dd00d98474a54e31d | 36,532,991,837,785 | 77121ac530439a434f55410281f92a14dd6fe213 | /src/test/java/runner/TestRunner.java | 0a4d2cd2326e20fc1632c056898642151f1ee352 | [] | no_license | freetorn2002/cucumber-jvm-framework | https://github.com/freetorn2002/cucumber-jvm-framework | ad0594ce736dac63e5a6144626efe1baa06ee2be | 01548091be7869c1bc13ccda26570fed37b10d06 | refs/heads/master | 2019-07-22T19:57:00.233000 | 2017-06-24T00:23:19 | 2017-06-24T00:23:19 | 95,264,004 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package runner;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features={"features"},glue={"stepDefinition"},plugin={"html:target/cucumber-html-report"})
public class TestRunner {
}
| UTF-8 | Java | 289 | java | TestRunner.java | Java | [] | null | [] | package runner;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features={"features"},glue={"stepDefinition"},plugin={"html:target/cucumber-html-report"})
public class TestRunner {
}
| 289 | 0.782007 | 0.782007 | 14 | 19.642857 | 28.055067 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 15 |
bb335144a9c33cbc0d188799a462840684bf696c | 9,285,719,301,073 | fd22391ec23e9c7ef9992e1347a561d0b47fe87a | /app/src/main/java/com/wechatbuddy/wechatbuddy/QRCodeRegenerator.java | 77aeef93b5015bfc564d1f64711d49fac11c050f | [] | no_license | tylerwowen/WeChatBuddyAndroid | https://github.com/tylerwowen/WeChatBuddyAndroid | f9e6405f54db2558744a00373bcfcf96494daf64 | ea243fc0b42420d27affe3558cb3af74b60a1c75 | refs/heads/master | 2021-01-15T16:53:25.306000 | 2015-10-31T04:05:02 | 2015-10-31T04:10:53 | 41,611,320 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | //
// QRCodeRegenerator.java
// WeChatBuddy
//
// Created by Tyler O on 8/29/15.
// Copyright (c) 2015 Tyler O, Jessie L, Kenneth C. All rights reserved.
package com.wechatbuddy.wechatbuddy;
import android.graphics.Bitmap;
import android.graphics.Color;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.EncodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.RGBLuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
class QRCodeRegenerator {
private Bitmap image = null; //UIImage *image
private String data = null; //NSString *data
public Bitmap regenerateQRCodeWithBitmap(Bitmap inputIMG) throws Exception {
this.image = inputIMG;
this.decodeOriginalImage();
this.encodeQRCode();
return this.image;
}
private void decodeOriginalImage() throws Exception {
int[] intArray = new int[image.getWidth()*image.getHeight()];
//copy pixel data from the Bitmap into the 'intArray' array
image.getPixels(intArray, 0, image.getWidth(), 0, 0, image.getWidth(), image.getHeight());
LuminanceSource source = new RGBLuminanceSource(image.getWidth(), image.getHeight(), intArray);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
Result result = reader.decode(bitmap);
this.data = new String(result.getText().getBytes(),"ISO-8859-1");
}
private void encodeQRCode() {
if(this.data == null) {
this.image = null;
return;
}
WBQRCodeWriter writer = new WBQRCodeWriter();
try {
BitMatrix matrix = writer.encode(this.data, BarcodeFormat.QR_CODE, 116, 116);
this.image = toBitmap(matrix);
}
// TODO: exception handling
catch (WriterException e) {
e.printStackTrace();
}
}
/**
* Writes the given Matrix on a new Bitmap object.
* @param matrix the matrix to write.
* @return the new {@link Bitmap}-object.
*/
private Bitmap toBitmap(BitMatrix matrix){
int height = matrix.getHeight();
int width = matrix.getWidth();
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
for (int x = 0; x < width; x++){
for (int y = 0; y < height; y++){
bmp.setPixel(x, y, matrix.get(x,y) ? Color.BLACK : Color.WHITE);
}
}
return bmp;
}
}
| UTF-8 | Java | 2,818 | java | QRCodeRegenerator.java | Java | [
{
"context": "Regenerator.java\n// WeChatBuddy\n//\n// Created by Tyler O on 8/29/15.\n// Copyright (c) 2015 Tyler O, Jessi",
"end": 71,
"score": 0.9998488426208496,
"start": 64,
"tag": "NAME",
"value": "Tyler O"
},
{
"context": "ated by Tyler O on 8/29/15.\n// Copyright (c) 2015... | null | [] | //
// QRCodeRegenerator.java
// WeChatBuddy
//
// Created by <NAME> on 8/29/15.
// Copyright (c) 2015 <NAME>, <NAME>, <NAME>. All rights reserved.
package com.wechatbuddy.wechatbuddy;
import android.graphics.Bitmap;
import android.graphics.Color;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.EncodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.RGBLuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
class QRCodeRegenerator {
private Bitmap image = null; //UIImage *image
private String data = null; //NSString *data
public Bitmap regenerateQRCodeWithBitmap(Bitmap inputIMG) throws Exception {
this.image = inputIMG;
this.decodeOriginalImage();
this.encodeQRCode();
return this.image;
}
private void decodeOriginalImage() throws Exception {
int[] intArray = new int[image.getWidth()*image.getHeight()];
//copy pixel data from the Bitmap into the 'intArray' array
image.getPixels(intArray, 0, image.getWidth(), 0, 0, image.getWidth(), image.getHeight());
LuminanceSource source = new RGBLuminanceSource(image.getWidth(), image.getHeight(), intArray);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
Result result = reader.decode(bitmap);
this.data = new String(result.getText().getBytes(),"ISO-8859-1");
}
private void encodeQRCode() {
if(this.data == null) {
this.image = null;
return;
}
WBQRCodeWriter writer = new WBQRCodeWriter();
try {
BitMatrix matrix = writer.encode(this.data, BarcodeFormat.QR_CODE, 116, 116);
this.image = toBitmap(matrix);
}
// TODO: exception handling
catch (WriterException e) {
e.printStackTrace();
}
}
/**
* Writes the given Matrix on a new Bitmap object.
* @param matrix the matrix to write.
* @return the new {@link Bitmap}-object.
*/
private Bitmap toBitmap(BitMatrix matrix){
int height = matrix.getHeight();
int width = matrix.getWidth();
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
for (int x = 0; x < width; x++){
for (int y = 0; y < height; y++){
bmp.setPixel(x, y, matrix.get(x,y) ? Color.BLACK : Color.WHITE);
}
}
return bmp;
}
}
| 2,811 | 0.647622 | 0.637686 | 90 | 30.311111 | 25.893648 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.7 | false | false | 15 |
d5d8b3fd7f75208c9b58ac7c36295f167845c591 | 33,715,493,325,515 | 1ed5c16927e98d62a160cf52ef563cd4a45e2122 | /backups/Copy (2) of Proshop_dlott.java | 775c3026d0f8d41d6672568760d4cb869d23ff1a | [] | no_license | uksubs66/java-v2 | https://github.com/uksubs66/java-v2 | b1517d1866360ffca7356d61bb360233ea479f58 | baba766e11ca8bb1930db5cb0d3b645ed9e7250c | refs/heads/master | 2021-01-25T08:59:44.495000 | 2015-07-17T15:37:27 | 2015-07-17T15:37:27 | 39,220,401 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /***************************************************************************************
* Proshop_dlott: This servlet will process the Lottery requests
*
*
* called by:
*
*
* parms passed (on doGet):
*
*
* created: 3/22/2007 Paul S.
*
* last updated:
*
*
*
***************************************************************************************
*/
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.util.zip.*;
import java.sql.*;
import java.lang.Math;
import javax.mail.internet.*;
import javax.mail.*;
import javax.activation.*;
// foretees imports
import com.foretees.common.parmSlot;
import com.foretees.common.parmClub;
import com.foretees.common.verifySlot;
import com.foretees.common.parmCourse;
import com.foretees.common.getParms;
import com.foretees.common.getClub;
import com.foretees.common.parmEmail;
import com.foretees.common.sendEmail;
public class Proshop_dlott extends HttpServlet {
String rev = SystemUtils.REVLEVEL; // Software Revision Level (Version)
String delim = "_";
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setHeader("Pragma", "no-cache"); // these 3 added to fix 'blank screen' problem
resp.setHeader("Cache-Control", "no-cache");
resp.setDateHeader("Expires", 0);
resp.setContentType("text/html");
PrintWriter out;
PreparedStatement pstmtc = null;
Statement stmt = null;
Statement stmtc = null;
ResultSet rs = null;
ResultSet rs2 = null;
//
// use GZip (compression) if supported by browser
//
String encodings = req.getHeader("Accept-Encoding"); // browser encodings
if ((encodings != null) && (encodings.indexOf("gzip") != -1)) { // if browser supports gzip
OutputStream out1 = resp.getOutputStream();
out = new PrintWriter(new GZIPOutputStream(out1), false); // use compressed output stream
resp.setHeader("Content-Encoding", "gzip"); // indicate gzip
} else {
out = resp.getWriter(); // normal output stream
}
HttpSession session = SystemUtils.verifyPro(req, out); // check for intruder
if (session == null) {
out.println(SystemUtils.HeadTitle("Access Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>System Access Error</H3>");
out.println("<BR><BR>You have entered this site incorrectly or have lost your session cookie.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
Connection con = SystemUtils.getCon(session); // get DB connection
if (con == null) {
out.println(SystemUtils.HeadTitle("DB Connection Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>Database Connection Error</H3>");
out.println("<BR><BR>Unable to connect to the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// Check for 'Insert' or 'Delete' request
//
if (req.getParameter("insert") != null) {
doInsert(req, out, con, session); // process insert request
return;
}
if (req.getParameter("delete") != null) {
if (req.getParameter("lotteryId") != null) {
doDeleteLottery(req, out, con, session);
} else {
doDelete(req, out, con, session);
}
return;
}
//
// get name of club for this user
//
String club = (String)session.getAttribute("club");
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// parm block to hold the club parameters
//
parmClub parm = new parmClub(); // allocate a parm block
//
// parm block to hold the course parameters
//
parmCourse parmc = new parmCourse(); // allocate a parm block
String event = "";
String ecolor = "";
String rest = "";
String rcolor = "";
String rest_recurr = "";
String rest5 = "";
String bgcolor5 = "";
String player = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String p1 = "";
String p2 = "";
String p3 = "";
String p4 = "";
String p5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String ampm = "";
String event_rest = "";
String bgcolor = "";
String stime = "";
String sshow = "";
String sfb = "";
String submit = "";
String num = "";
String jumps = "";
String hole = "";
String event1 = ""; // for legend - max 2 events, 4 rest's, 2 lotteries
String ecolor1 = "";
String rest1 = "";
String rcolor1 = "";
String event2 = "";
String ecolor2 = "";
String rest2 = "";
String rcolor2 = "";
String rest3 = "";
String rcolor3 = "";
String rest4 = "";
String rcolor4 = "";
String blocker = "";
String bag = "";
String conf = "";
String orig_by = "";
String orig_name = "";
String errMsg = "";
String emailOpt = "";
String lottery_color = "";
String lottery = "";
String lottery_recurr = "";
String lott = "";
String lott1 = "";
String lott2 = "";
String lott3 = "";
String lott_color = "";
String lott_color2 = "";
String lott_recurr = "";
String lcolor1 = "";
String lcolor2 = "";
String lcolor3 = "";
int jump = 0;
int j = 0;
int i = 0;
int hr = 0;
int min = 0;
int time = 0;
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int type = 0;
int in_use = 0;
int fives = 0;
int fivesALL = 0;
int teecurr_id = 0;
int shotgun = 1;
int g1 = 0;
int g2 = 0;
int g3 = 0;
int g4 = 0;
int g5 = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
short fb = 0;
int lott_start_time = 0;
int lott_end_time = 0;
//
// Array to hold the course names
//
int cMax = 21;
String [] courseA = new String [cMax]; // max of 20 courses per club
String courseName = ""; // max of 20 courses per club
String courseName1 = "";
String courseT = "";
int tmp_i = 0;
int [] fivesA = new int [cMax]; // array to hold 5-some option for each course
String [] course_color = new String [cMax];
// set default course colors // NOTE: CHANES TO THIS ARRAY NEED TO BE DUPLICATED IN Proshop_sheet.java
course_color[0] = "#F5F5DC"; // beige shades
course_color[1] = "#DDDDBE";
course_color[2] = "#B3B392";
course_color[3] = "#8B8970";
course_color[4] = "#E7F0E7"; // greens shades
course_color[5] = "#C6D3C6";
course_color[6] = "#648A64";
course_color[7] = "#407340";
course_color[8] = "#FFE4C4"; // bisque
course_color[9] = "#95B795";
course_color[10] = "#66CDAA"; // medium aquamarine
course_color[11] = "#20B2AA"; // light seagreen
course_color[12] = "#3CB371"; // medium seagreen
course_color[13] = "#F5DEB3"; // wheat
course_color[14] = "#D2B48C"; // tan
course_color[15] = "#999900"; //
course_color[16] = "#FF9900"; // red-orange??
course_color[17] = "#33FF66"; //
course_color[18] = "#7FFFD4"; // aquamarine
course_color[19] = "#33FFFF"; //
course_color[20] = "#FFFFFF"; // white
String hideUnavail = req.getParameter("hide");
if (hideUnavail == null) hideUnavail = "";
//
// Get the golf course name requested (changed to use the course specified for this lottery)
//
String course = req.getParameter("course");
if (course == null) course = "";
//
// Get the name of the lottery requested
//
String lott_name = req.getParameter("lott_name");
if (lott_name == null) lott_name = "";
//
// 'index' contains an index value representing the date selected
// (0 = today, 1 = tomorrow, etc.)
//
int index = 0;
num = req.getParameter("index"); // get the index value of the day selected
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(num);
}
catch (NumberFormatException e) { }
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead 'index' days
int cal_hour = cal.get(Calendar.HOUR_OF_DAY); // 24 hr clock (0 - 23)
int cal_min = cal.get(Calendar.MINUTE);
int cal_time = (cal_hour * 100) + cal_min; // get time in hhmm format
cal_time = SystemUtils.adjustTime(con, cal_time);
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
String day_name = day_table[day_num]; // get name for day
long date = (year * 10000) + (month * 100) + day; // create a date field of yyyymmdd
String date_mysql = year + "-" + SystemUtils.ensureDoubleDigit(month) + "-" + SystemUtils.ensureDoubleDigit(day);
String time_mysql = (cal_time / 100) + ":" + SystemUtils.ensureDoubleDigit(cal_time % 100) + ":00"; // current time for
out.println("<!-- date_mysql=" + date_mysql + " -->");
out.println("<!-- cal_time=" + cal_time + " -->");
// huge try/catch that spans entire method
try {
errMsg = "Get course names.";
//
// Get the Guest Types from the club db
//
getClub.getParms(con, parm); // get the club parms
//
// Remove any guest types that are null - for tests below
//
i = 0;
while (i < parm.MAX_Guests) {
if (parm.guest[i].equals( "" )) {
parm.guest[i] = "$@#!^&*"; // make so it won't match player name
}
i++;
} // end of while loop
//
// Get course names if multi-course facility so we can determine if any support 5-somes
//
i = 0;
int courseCount = 0;
//if (course.equals("")) {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT courseName, stime, etime " +
"FROM lottery3 " +
"WHERE name = ?");
pstmt.clearParameters();
pstmt.setString(1, lott_name);
rs = pstmt.executeQuery();
if (rs.next()) {
if (parm.multi != 0 && course.equals("")) course = rs.getString(1); // if no course was specified (default) then set the course variable to the course this lottery is for
lott_start_time = rs.getInt(2);
lott_end_time = rs.getInt(3);
}
//}
if (parm.multi != 0) { // if multiple courses supported for this club
// init the course array
while (i < cMax) {
courseA[i] = "";
i++;
}
i = 0;
int total = 0;
//
// Get the names of all courses for this club
//
pstmt = con.prepareStatement("SELECT courseName FROM clubparm2;");
pstmt.clearParameters();
rs = pstmt.executeQuery();
while (rs.next() && i < cMax) {
courseName = rs.getString(1);
courseA[i] = courseName; // add course name to array
i++;
}
pstmt.close();
if (i > cMax) { // make sure we didn't go past max
courseCount = cMax;
} else {
courseCount = i; // save number of courses
}
if (i > 1 && i < cMax) {
courseA[i] = "-ALL-"; // add '-ALL-' option
}
//
// Make sure we have a course (in case we came directly from the Today's Tee Sheet menu)
//
if (courseName1.equals( "" )) {
courseName1 = courseA[0]; // grab the first one
}
} // end if multiple courses supported
//
// Get the walk/cart options available and 5-some support
//
i = 0;
if (course.equals( "-ALL-" )) {
//
// Check all courses for 5-some support
//
loopc:
while (i < cMax) {
courseName = courseA[i]; // get a course name
if (!courseName.equals( "-ALL-" )) { // skip if -ALL-
if (courseName.equals( "" )) { // done if null
break loopc;
}
getParms.getCourse(con, parmc, courseName);
fivesA[i] = parmc.fives; // get fivesome option
if (fivesA[i] == 1) {
fives = 1;
}
}
i++;
}
} else { // single course requested
getParms.getCourse(con, parmc, course);
fives = parmc.fives; // get fivesome option
}
fivesALL = fives; // save 5-somes option for table display below
i = 0;
//
// Statements to find any restrictions, events or lotteries for today
//
String string7b = "";
String string7c = "";
String string7d = "";
if (course.equals( "-ALL-" )) {
string7b = "SELECT name, recurr, color FROM restriction2 WHERE sdate <= ? AND edate >= ? " +
"AND showit = 'Yes'";
} else {
string7b = "SELECT name, recurr, color FROM restriction2 WHERE sdate <= ? AND edate >= ? " +
"AND (courseName = ? OR courseName = '-ALL-') AND showit = 'Yes'";
}
if (course.equals( "-ALL-" )) {
string7c = "SELECT name, color FROM events2b WHERE date = ?";
} else {
string7c = "SELECT name, color FROM events2b WHERE date = ? " +
"AND (courseName = ? OR courseName = '-ALL-')";
}
if (course.equals( "-ALL-" )) {
string7d = "SELECT name, recurr, color, sdays, sdtime, edays, edtime, pdays, ptime, slots " +
"FROM lottery3 WHERE sdate <= ? AND edate >= ?";
} else {
string7d = "SELECT name, recurr, color, sdays, sdtime, edays, edtime, pdays, ptime, slots " +
"FROM lottery3 WHERE sdate <= ? AND edate >= ? " +
"AND (courseName = ? OR courseName = '-ALL-')";
}
PreparedStatement pstmt7b = con.prepareStatement (string7b);
PreparedStatement pstmt7c = con.prepareStatement (string7c);
PreparedStatement pstmt7d = con.prepareStatement (string7d);
errMsg = "Scan Restrictions.";
//
// Scan the events, restrictions and lotteries to build the legend
//
pstmt7b.clearParameters(); // clear the parms
pstmt7b.setLong(1, date);
pstmt7b.setLong(2, date);
if (!course.equals( "-ALL-" )) {
pstmt7b.setString(3, course);
}
rs = pstmt7b.executeQuery(); // find all matching restrictions, if any
while (rs.next()) {
rest = rs.getString(1);
rest_recurr = rs.getString(2);
rcolor = rs.getString(3);
//
// We must check the recurrence for this day (Monday, etc.)
//
if ((rest_recurr.equals( "Every " + day_name )) || // if this day
(rest_recurr.equalsIgnoreCase( "every day" )) || // or everyday
((rest_recurr.equalsIgnoreCase( "all weekdays" )) && // or all weekdays (and this is one)
(!day_name.equalsIgnoreCase( "saturday" )) &&
(!day_name.equalsIgnoreCase( "sunday" ))) ||
((rest_recurr.equalsIgnoreCase( "all weekends" )) && // or all weekends (and this is one)
(day_name.equalsIgnoreCase( "saturday" ))) ||
((rest_recurr.equalsIgnoreCase( "all weekends" )) &&
(day_name.equalsIgnoreCase( "sunday" )))) {
if ((!rest.equals( rest1 )) && (rest1.equals( "" ))) {
rest1 = rest;
rcolor1 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor1 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (rest2.equals( "" ))) {
rest2 = rest;
rcolor2 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor2 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (!rest.equals( rest3 )) && (rest3.equals( "" ))) {
rest3 = rest;
rcolor3 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor3 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (!rest.equals( rest3 )) &&
(!rest.equals( rest4 )) && (rest4.equals( "" ))) {
rest4 = rest;
rcolor4 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor4 = "#F5F5DC";
}
}
}
}
}
}
} // end of while
pstmt7b.close();
errMsg = "Scan Events.";
pstmt7c.clearParameters(); // clear the parms
pstmt7c.setLong(1, date);
if (!course.equals( "-ALL-" )) {
pstmt7c.setString(2, course);
}
rs = pstmt7c.executeQuery(); // find all matching events, if any
while (rs.next()) {
event = rs.getString(1);
ecolor = rs.getString(2);
if ((!event.equals( event1 )) && (event1.equals( "" ))) {
event1 = event;
ecolor1 = ecolor;
if (ecolor.equalsIgnoreCase( "default" )) {
ecolor1 = "#F5F5DC";
}
} else {
if ((!event.equals( event1 )) && (!event.equals( event2 )) && (event2.equals( "" ))) {
event2 = event;
ecolor2 = ecolor;
if (ecolor.equalsIgnoreCase( "default" )) {
ecolor2 = "#F5F5DC";
}
}
}
} // end of while
pstmt7c.close();
//****************************************************
// Define tee sheet size and build it
//****************************************************
// define our two arrays that describe the column sizes
// index = column number, value = size in pixels
int [] col_width = new int [15];
int col_start[] = new int[15]; // total width = 962 px (in dts-styles.css)
int [] lcol_width = new int [8];
int lcol_start[] = new int[8];
lcol_width[0] = 0; // unused
lcol_width[1] = 40; // +/-
lcol_width[2] = (course.equals( "-ALL-" )) ? 71 : 80; // desired time
lcol_width[3] = (course.equals( "-ALL-" )) ? 71 : 80; // assigned time
lcol_width[4] = 120; // acceptable time
lcol_width[5] = (course.equals( "-ALL-" )) ? 90 : 0; // course
lcol_width[6] = 40; // weight
lcol_width[7] = (fivesALL == 0) ? 410 : 560; // members
lcol_start[1] = 0;
lcol_start[2] = lcol_start[1] + lcol_width[1];
lcol_start[3] = lcol_start[2] + lcol_width[2];
lcol_start[4] = lcol_start[3] + lcol_width[3];
lcol_start[5] = lcol_start[4] + lcol_width[4];
lcol_start[6] = lcol_start[5] + lcol_width[5];
lcol_start[7] = lcol_start[6] + lcol_width[6];
if (course.equals( "-ALL-" )) {
col_width[0] = 0; // unused
col_width[1] = 40; // +/-
col_width[2] = 71; // time
col_width[3] = 90; // course name col 69
col_width[4] = 31; // f/b
col_width[5] = 111; // player 1
col_width[6] = 39; // player 1 trans opt
col_width[7] = 111; // player 2
col_width[8] = 39; // player 2 trans opt
col_width[9] = 111; // player 3
col_width[10] = 39; // player 3 trans opt
col_width[11] = 111; // player 4
col_width[12] = 39; // player 4 trans opt
col_width[13] = 111; // player 5
col_width[14] = 39; // player 5 trans opt
} else {
col_width[0] = 0; // unused
col_width[1] = 40; // +/-
col_width[2] = 80; // time
col_width[3] = 0; // empty if no course name
col_width[4] = 40; // f/b
col_width[5] = 120; // player 1
col_width[6] = 40; // player 1 trans opt
col_width[7] = 120; // player 2
col_width[8] = 40; // player 2 trans opt
col_width[9] = 120; // player 3
col_width[10] = 40; // player 3 trans opt
col_width[11] = 120; // player 4
col_width[12] = 40; // player 4 trans opt
col_width[13] = 120; // player 5
col_width[14] = 40; // player 5 trans opt
}
col_start[1] = 0;
col_start[2] = col_start[1] + col_width[1];
col_start[3] = col_start[2] + col_width[2];
col_start[4] = col_start[3] + col_width[3];
col_start[5] = col_start[4] + col_width[4];
col_start[6] = col_start[5] + col_width[5];
col_start[7] = col_start[6] + col_width[6];
col_start[8] = col_start[7] + col_width[7];
col_start[9] = col_start[8] + col_width[8];
col_start[10] = col_start[9] + col_width[9];
col_start[11] = col_start[10] + col_width[10];
col_start[12] = col_start[11] + col_width[11];
col_start[13] = col_start[12] + col_width[12];
col_start[14] = col_start[13] + col_width[13];
int total_col_width = col_start[14] + col_width[14];
// temp variable
String dts_tmp = "";
//
// Build the HTML page
//
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<html>\n<!--Copyright notice: This software (including any images, servlets, applets, photographs, animations, video, music and text incorporated into the software) ");
out.println("is the proprietary property of ForeTees, LLC or its suppliers and its use, modification and distribution are protected ");
out.println("and limited by United States copyright laws and international treaty provisions and all other applicable national laws. ");
out.println("\nReproduction is strictly prohibited.-->");
out.println("<head>");
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">");
out.println("<meta http-equiv=\"Content-Language\" content=\"en-us\">");
out.println("<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">");
out.println("<link rel=\"stylesheet\" href=\"/" +rev+ "/dts-styles.css\">");
out.println("<title>Proshop Tee Sheet Management Page</title>");
out.println("<script language=\"javascript\">"); // Jump script
out.println("<!--");
out.println("function jumpToHref(anchorstr) {");
out.println("if (location.href.indexOf(anchorstr)<0) {");
out.println(" location.href=anchorstr; }");
out.println("}");
out.println("// -->");
out.println("</script>"); // End of script
// include dts javascript source file
out.println("<script language=\"javascript\" src=\"/" +rev+ "/dts-scripts.js\"></script>");
out.println("</head>");
out.println("<body onLoad='jumpToHref(\"#jump" + jump + "\");' bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\"><center>");
out.println("<a name=\"jump0\"></a>"); // create a default jump label (start of page)
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // table for cmd tbl & instructions
out.println("<tr><td align=\"left\" valign=\"middle\">");
//
// Build Control Panel
//
out.println("<table border=\"1\" width=\"130\" cellspacing=\"3\" cellpadding=\"3\" bgcolor=\"8B8970\" align=\"left\">");
out.println("<tr>");
out.println("<td align=\"center\"><font size=\"3\"><b>Control Panel</b><br>");
out.println("</font></td></tr><tr><td align=\"center\"><font size=\"2\">");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "\" title=\"Refresh Sheet\" alt=\"Refresh Sheet\">");
out.println("Refresh Sheet</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + ((hideUnavail.equals("1") ? "" : "&hide=1")) + "\" title=\"Lottery Times Only\" alt=\"Lottery Times Only\">");
out.println((hideUnavail.equals("1") ? "Show All Tee Times" : "Show Lottery Times Only") + "</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&convert=all\" title=\"Convert All Requests\" alt=\"Convert All Requests\">");
out.println("Convert Assigned Requests</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +index+ "&course=" +course+ "\" title=\"Return to Tee Sheet\" alt=\"Return\">");
out.println("Return to Tee Sheet</a><br>");
out.println("</font></td></tr></table>"); // end Control Panel table
out.println("</td>"); // end of column for control panel
out.println("<td align=\"center\" width=\"20\"> "); // empty column for spacer
out.println("</td>");
out.println("<td align=\"left\" valign=\"top\">"); // column for instructions, course selector, calendars??
//**********************************************************
// Continue with instructions and tee sheet
//**********************************************************
out.println("<table cellpadding=\"5\" cellspacing=\"3\" width=\"80%\">");
out.println("<tr><td align=\"center\">");
out.println("<p align=\"center\"><font size=\"5\">Golf Shop Lottery Management</font></p>");
out.println("</td></tr></table>");
out.println("<table cellpadding=\"3\" width=\"80%\">");
out.println("<tr><td bgcolor=\"#336633\"><font color=\"#FFFFFF\" size=\"2\">");
out.println("<b>Instructions:</b>");
out.println("To <b>insert</b> a new tee time, click on the plus icon <img src=/v5/images/dts_newrow.gif width=13 height=13 border=0> in the tee time you wish to insert <i>after</i>. ");
out.println("To <b>delete</b> a tee time, click on the trash can icon <img src=/v5/images/dts_trash.gif width=13 height=13 border=0> in the tee time you wish to delete. ");
out.println("To <b>move an entire tee time</b>, click on the 'Time' value and drag the tee time to the new position. ");
out.println("To <b>move an individual player</b>, click on the Player and drag the name to the new position. ");
out.println("To <b>change</b> the F/B value or the C/W value, just click on it and make the selection. ");
out.println("Empty 'player' cells indicate available positions. ");
out.println("Special Events and Restrictions, if any, are colored (see legend below).");
out.println("</font></td></tr></table>");
out.println("</td></tr></table>"); // end tbl for instructions
out.println("<p><font size=\"2\">");
out.println("Date: <b>" + day_name + " " + month + "/" + day + "/" + year + "</b>");
if (!course.equals( "" )) {
out.println(" Course: <b>" + course + "</b></p>");
}
//
// If multiple courses, then add a drop-down box for course names
//
String tmp_ncount = "";
out.println("<!-- courseCount=" + courseCount + " -->");
if (parm.multi != 0) { // if multiple courses supported for this club
//
// use 2 forms so you can switch by clicking either a course or a date
//
if (courseCount < 5) { // if < 5 courses, use buttons
i = 0;
courseName = courseA[i]; // get first course name from array
out.println("<p><font size=\"2\">");
out.println("<b>Select Course:</b> ");
while ((!courseName.equals( "" )) && (i < 6)) { // allow one more for -ALL-
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseName+ "&hide=" + hideUnavail + "&lott_name=" + lott_name + "\" style=\"color:blue\" target=\"_top\" title=\"Switch to new course\" alt=\"" +courseName+ "\">");
out.print(courseName + "</a>");
out.print(" ");
i++;
courseName = courseA[i]; // get course name from array
}
out.println("</p>");
}
else
{ // use drop-down menu
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" name=\"cform\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">"); // use current date
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"select\">");
i = 0;
courseName = courseA[i]; // get first course name from array
out.println("<b>Course:</b> ");
out.println("<select size=\"1\" name=\"course\" onchange=\"document.cform.submit()\">");
while ((!courseName.equals( "" )) && (i < cMax)) {
out.println("<option " + ((courseName.equals( course )) ? "selected " : "") + "value=\"" + courseName + "\">" + courseName + "</option>");
i++;
if (i < cMax) courseName = courseA[i]; // get course name from array
}
out.println("</select>");
out.println("</form>");
} // end either display href links or drop down select
} // end if multi course
if (!event1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + ecolor1 + "\">" + event1 + "</button>");
out.println(" ");
if (!event2.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + ecolor2 + "\">" + event2 + "</button>");
out.println(" ");
}
}
if (!rest1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + rcolor1 + "\">" + rest1 + "</button>");
if (!rest2.equals( "" )) {
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor2 + "\">" + rest2 + "</button>");
if (!rest3.equals( "" )) {
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor3 + "\">" + rest3 + "</button>");
if ((!rest4.equals( "" )) && (event1.equals( "" ))) { // do 4 rest's if no events
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor4 + "\">" + rest4 + "</button>");
}
}
}
}
if (!lott1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor1 + "\">Lottery Times</button>");
out.println(" ");
if (!lott2.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor2 + "\">Lottery Times</button>");
out.println(" ");
if (!lott3.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor3 + "\">Lottery Times</button>");
out.println(" ");
}
}
}
if (!event1.equals( "" ) || !rest1.equals( "" ) || !lott1.equals( "" )) {
out.println("<br>");
}
// *** these two lines came up from after tee sheet
out.println("</td></tr>");
out.println("</table>"); // end of main page table
out.println("<br>");
out.println("<font size=\"2\">");
out.println("<b>Lottery Request Legend</b>");
out.println("</font><br><font size=\"1\">");
out.println("<b>m/-:</b> c = Move to Tee Sheet, minus = Delete Request, ");
out.println("<b>Desired:</b> Desired Time, <b>Assigned:</b> System Assigned Time<br>");
out.println("<b>Acceptable:</b> Range of Acceptable Times <b>W:</b> Weight");
out.println("</font>");
out.println("</center>");
//****************************************************************************
//
// start html for display of lottery requests
//
//****************************************************************************
//
// IMAGE MARKER FOR POSITIONING
out.println("<img src=\"/"+rev+"/images/shim.gif\" width=1 height=1 border=0 id=imgMarker name=imgMarker>");
out.println("\n<!-- START OF LOTTERY REQ SHEET HEADER -->");
out.println(""); // width=" + total_col_width + " align=center
out.println("<div id=\"elHContainer2\">");
out.println("<span class=header style=\"left: " +lcol_start[1]+ "px; width: " +lcol_width[1]+ "px\">c/-</span><span");
out.println(" class=header style=\"left: " +lcol_start[2]+ "px; width: " +lcol_width[2]+ "px\">Assigned</span><span");
out.println(" class=header style=\"left: " +lcol_start[3]+ "px; width: " +lcol_width[3]+ "px\">Desired</span><span");
out.println(" class=header style=\"left: " +lcol_start[4]+ "px; width: " +lcol_width[4]+ "px\">Acceptable</span><span");
if (course.equals( "-ALL-" )) {
out.println(" class=header style=\"left: " +lcol_start[5]+ "px; width: " +lcol_width[5]+ "px\">Course</span><span ");
}
out.println(" class=header style=\"left: " +lcol_start[6]+ "px; width: " +lcol_width[6]+ "px\">W</span><span id=widthMarker2 ");
out.println(" class=header style=\"left: " +lcol_start[7]+ "px; width: " +lcol_width[7]+ "px\">Members</span>");
out.print("</div>\n");
out.println("<!-- END OF LOTTERY REQ HEADER -->\n");
out.println("\n<!-- START OF LOTTERY REQ SHEET BODY -->");
out.println("<div id=\"elContainer2\">");
errMsg = "Reading Lottery Requests";
out.println("<!-- lott_name=" + lott_name + " -->");
out.println("<!-- date=" + date + " -->");
pstmt = con.prepareStatement ("" +
"SELECT c.fives, l.* " +
"FROM lreqs3 l, clubparm2 c " +
"WHERE name = ? AND date = ? AND c.courseName = l.courseName " +
(course.equals("-ALL-") ? "" : " AND l.courseName = ? ") + " " +
"ORDER BY atime1;");
pstmt.clearParameters();
pstmt.setString(1, lott_name);
pstmt.setLong(2, date);
if (!course.equals("-ALL-")) pstmt.setString(3, course);
rs = pstmt.executeQuery();
boolean tmp_found = false;
boolean tmp_found2 = false;
int lottery_id = 0;
int nineHole = 0;
int eighteenHole = 0;
int friends = 0;
int groups = 0;
int max_players = 0;
int sum_players = 0;
int req_time = 0;
int tmp_groups = 1;
int dts_slot_index = 0; // slot index number
int request_color = 0;
String fullName = "";
String cw = "";
String notes = "";
String in_use_by = "";
String time_color = "";
String dts_defaultF3Color = "#FFFFFF"; // default
while (rs.next()) {
tmp_found = true;
sum_players = 0;
nineHole = 0;
eighteenHole = 0;
in_use_by = "";
lottery_id = rs.getInt("id");
courseName = rs.getString("courseName");
req_time = rs.getInt("time");
notes = rs.getString("notes");
groups = rs.getInt("groups");
in_use = rs.getInt("in_use");
max_players = ((rs.getInt("fives") == 0 || rs.getString("p5").equalsIgnoreCase("No")) ? 4 : 5);
if (in_use == 1) in_use_by = rs.getString("in_use_by");
j++; // increment the jump label index (where to jump on page)
if (course.equals( "-ALL-" )) { // only display this col if multi course club
for (tmp_i = 0; tmp_i < courseCount; tmp_i++) {
if (courseName.equals(courseA[tmp_i])) break;
}
}
/*
if (groups == 1) {
buildRow(dts_slot_index, 1, course, course_color[tmp_i], bgcolor, max_players, courseCount, lcol_start, lcol_width, index, emailOpt, j, course_color[request_color + 13], false, hideUnavail, lott_name, rs, out);
dts_slot_index++;
request_color++;
} else {
*/
tmp_groups = 1; // reset
while (tmp_groups <= groups) {
buildRow(dts_slot_index, tmp_groups, course, course_color[tmp_i], bgcolor, max_players, courseCount, lcol_start, lcol_width, index, emailOpt, j, course_color[request_color + 13], (tmp_groups > 1), hideUnavail, lott_name, rs, out);
tmp_groups++;
dts_slot_index++;
} // end while
request_color++;
//} // end if multiple groups
} // end rs loop of lottery requests
out.println("<!-- total_lottery_slots=" + dts_slot_index + " -->");
out.println("</div>"); // end container
out.println("\n<!-- END OF LOTTERY REQ SHEET BODY -->");
out.println("<p> </p>");
int total_lottery_slots = dts_slot_index;
dts_slot_index = 0;
in_use = 0;
//
// End display notifications
//
out.println("<div id=tblLegend style=\"position:absolute\"><p align=center><font size=\"2\">");
out.println("<b>" + ((index < 0) ? "Old " : "") + "Tee Sheet Legend</b>");
out.println("</font><br><font size=\"1\">");
out.println("<b>F/B:</b> F = Front Nine, B = Back Nine, ");
out.println("O = Open (for cross-overs), S = Shotgun Event");
out.println("</font></p></div>");
//****************************************************************************
//
// start html for tee sheet
//
//****************************************************************************
//
// To change the position of the tee sheet (static position from top):
//
// Edit file 'dts-styles.css'
// "top" property for elHContainer (header for the main container)
// "top" property for elContainer (main container that holds the tee sheet elements)
// Increment both numbers equally!!!!!!!!!!!!
//
//****************************************************************************
String tmpCW = "C/W";
out.println("<br>");
out.println("\n<!-- START OF TEE SHEET HEADER -->");
out.println(""); // width=" + total_col_width + " align=center
out.println("<div id=\"elHContainer\">");
out.println("<span class=header style=\"left: " +col_start[1]+ "px; width: " +col_width[1]+ "px\">+/-</span><span");
out.println(" class=header style=\"left: " +col_start[2]+ "px; width: " +col_width[2]+ "px\">Time</span><span");
if (course.equals( "-ALL-" )) {
out.println(" class=header style=\"left: " +col_start[3]+ "px; width: " +col_width[3]+ "px\">Course</span><span ");
}
out.println(" class=header style=\"left: " +col_start[4]+ "px; width: " +col_width[4]+ "px\">F/B</span><span ");
out.println(" class=header style=\"left: " +col_start[5]+ "px; width: " +col_width[5]+ "px\">Player 1</span><span ");
out.println(" class=header style=\"left: " +col_start[6]+ "px; width: " +col_width[6]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[7]+ "px; width: " +col_width[7]+ "px\">Player 2</span><span ");
out.println(" class=header style=\"left: " +col_start[8]+ "px; width: " +col_width[8]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[9]+ "px; width: " +col_width[9]+ "px\">Player 3</span><span ");
out.println(" class=header style=\"left: " +col_start[10]+ "px; width: " +col_width[10]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[11]+ "px; width: " +col_width[11]+ "px\">Player 4</span><span ");
out.print(" class=header style=\"left: " +col_start[12]+ "px; width: " +col_width[12]+ "px\"");
if (fivesALL == 0)
{
out.print(" id=widthMarker>" +tmpCW+"</span>");
} else {
out.print(">" +tmpCW+ "</span><span \n class=header style=\"left: " +col_start[13]+ "px; width: " +col_width[13]+ "px\">Player 5</span><span ");
out.print(" \n class=header style=\"left: " +col_start[14]+ "px; width: " +col_width[14]+ "px\" id=widthMarker>" +tmpCW+ "</span>");
}
out.print("</div>\n");
out.println("<!-- END OF TEE SHEET HEADER -->\n");
String first = "yes";
errMsg = "Get tee times.";
//
// Get the tee sheet for this date
//
String stringTee = "";
stringTee = "SELECT * " +
"FROM teecurr2 " +
"WHERE date = ? " +
((course.equals( "-ALL-" )) ? "" : "AND courseName = ? ") +
((hideUnavail.equals("1")) ? "AND time >= ? AND time <= ? " : "") +
"ORDER BY time, courseName, fb";
out.println("<!-- index=" + index + " -->");
out.println("<!-- date=" + date + " -->");
out.println("<!-- lott_start_time=" + lott_start_time + " -->");
out.println("<!-- lott_end_time=" + lott_end_time + " -->");
out.println("<!-- course=" + course + " -->");
out.println("<!-- stringTee=" + stringTee + " -->");
pstmt = con.prepareStatement (stringTee);
int parm_index = 2;
int teepast_id = 0;
pstmt.clearParameters();
pstmt.setLong(1, date);
if (!course.equals( "-ALL-" )) {
pstmt.setString(2, course);
parm_index = 3;
}
if (hideUnavail.equals("1")) {
pstmt.setInt(parm_index, lott_start_time);
parm_index++;
pstmt.setInt(parm_index, lott_end_time);
}
rs = pstmt.executeQuery();
out.println("\n<!-- START OF TEE SHEET BODY -->");
out.println("<div id=\"elContainer\">\n");
// loop thru each of the tee times
while (rs.next()) {
player1 = rs.getString("player1");
player2 = rs.getString("player2");
player3 = rs.getString("player3");
player4 = rs.getString("player4");
player5 = rs.getString("player5");
p1cw = rs.getString("p1cw");
p2cw = rs.getString("p2cw");
p3cw = rs.getString("p3cw");
p4cw = rs.getString("p4cw");
p5cw = rs.getString("p5cw");
p91 = rs.getInt("p91");
p92 = rs.getInt("p92");
p93 = rs.getInt("p93");
p94 = rs.getInt("p94");
p95 = rs.getInt("p95");
time = rs.getInt("time");
fb = rs.getShort("fb");
courseT = rs.getString("courseName");
teecurr_id = rs.getInt("teecurr_id");
hr = rs.getInt("hr");
min = rs.getInt("min");
event = rs.getString("event");
ecolor = rs.getString("event_color");
rest = rs.getString("restriction");
rcolor = rs.getString("rest_color");
conf = rs.getString("conf");
in_use = rs.getInt("in_use");
type = rs.getInt("event_type");
hole = rs.getString("hole");
blocker = rs.getString("blocker");
rest5 = rs.getString("rest5");
bgcolor5 = rs.getString("rest5_color");
lottery = rs.getString("lottery");
lottery_color = rs.getString("lottery_color");
//
// If course=ALL requested, then set 'fives' option according to this course
//
if (course.equals( "-ALL-" )) {
i = 0;
loopall:
while (i < 20) {
if (courseT.equals( courseA[i] )) {
fives = fivesA[i]; // get the 5-some option for this course
break loopall; // exit loop
}
i++;
}
}
boolean blnHide = false;
// REMOVED HIDING OF FULL TEE TIMES
/*
if (hideUnavail.equals("1")) {
if (fives == 0 || !rest5.equals("") ) {
if ( !player1.equals("") && !player2.equals("") && !player3.equals("") && !player4.equals("") ) blnHide = true;
} else {
if ( !player1.equals("") && !player2.equals("") && !player3.equals("") && !player4.equals("") && !player5.equals("")) blnHide = true;
}
}
*/
// only show this slot if it is NOT blocked
// and hide it if fives are disallowed and player1-4 full (all slots full already excluded in sql)
if ( blocker.equals( "" ) && blnHide == false) { // continue if tee time not blocked - else skip
ampm = " AM";
if (hr == 12) {
ampm = " PM";
}
if (hr > 12) {
ampm = " PM";
hr = hr - 12; // convert to conventional time
}
bgcolor = "#FFFFFF"; //default
if (!event.equals("")) {
bgcolor = ecolor;
} else {
if (!rest.equals("")) {
bgcolor = rcolor;
} else {
if (!lottery_color.equals("")) {
bgcolor = lottery_color;
}
}
}
if (bgcolor.equals("Default")) {
bgcolor = "#FFFFFF"; //default
}
if (bgcolor5.equals("")) {
bgcolor5 = bgcolor; // player5 bgcolor = others if 5-somes not restricted
}
if (p91 == 1) { // if 9 hole round
p1cw = p1cw + "9";
}
if (p92 == 1) {
p2cw = p2cw + "9";
}
if (p93 == 1) {
p3cw = p3cw + "9";
}
if (p94 == 1) {
p4cw = p4cw + "9";
}
if (p95 == 1) {
p5cw = p5cw + "9";
}
if (player1.equals("")) {
p1cw = "";
}
if (player2.equals("")) {
p2cw = "";
}
if (player3.equals("")) {
p3cw = "";
}
if (player4.equals("")) {
p4cw = "";
}
if (player5.equals("")) {
p5cw = "";
}
g1 = 0; // init guest indicators
g2 = 0;
g3 = 0;
g4 = 0;
g5 = 0;
//
// Check if any player names are guest names
//
if (!player1.equals( "" )) {
i = 0;
ploop1:
while (i < parm.MAX_Guests) {
if (player1.startsWith( parm.guest[i] )) {
g1 = 1; // indicate player1 is a guest name
break ploop1;
}
i++;
}
}
if (!player2.equals( "" )) {
i = 0;
ploop2:
while (i < parm.MAX_Guests) {
if (player2.startsWith( parm.guest[i] )) {
g2 = 1; // indicate player2 is a guest name
break ploop2;
}
i++;
}
}
if (!player3.equals( "" )) {
i = 0;
ploop3:
while (i < parm.MAX_Guests) {
if (player3.startsWith( parm.guest[i] )) {
g3 = 1; // indicate player3 is a guest name
break ploop3;
}
i++;
}
}
if (!player4.equals( "" )) {
i = 0;
ploop4:
while (i < parm.MAX_Guests) {
if (player4.startsWith( parm.guest[i] )) {
g4 = 1; // indicate player4 is a guest name
break ploop4;
}
i++;
}
}
if (!player5.equals( "" )) {
i = 0;
ploop5:
while (i < parm.MAX_Guests) {
if (player5.startsWith( parm.guest[i] )) {
g5 = 1; // indicate player5 is a guest name
break ploop5;
}
i++;
}
}
//
// Process the F/B parm 0 = Front 9, 1 = Back 9, 9 = none (open for cross-over)
//
sfb = "F"; // default Front 9
if (fb == 1) {
sfb = "B";
}
if (fb == 9) {
sfb = "O";
}
if (type == shotgun) {
sfb = (!hole.equals("")) ? hole : "S"; // there's an event and its type is 'shotgun'
}
// set default color for first three columns
if (in_use != 0) dts_defaultF3Color = "";
//
//**********************************
// Build the tee time rows
//**********************************
//
if (min < 10) {
dts_tmp = hr + ":0" + min + ampm;
} else {
dts_tmp = hr + ":" + min + ampm;
}
out.print("<div id=time_slot_"+ dts_slot_index +" time=\"" + time + "\" course=\"" + courseT + "\" startX=0 startY=0 tid="+((teecurr_id == 0) ? teepast_id : teecurr_id)+" ");
if (in_use == 0 && index >= 0) {
// not in use
out.println("class=timeSlot drag=true style=\"background-color: "+ bgcolor +"\" bgc=\""+ bgcolor +"\">");
} else {
// in use
out.println("class=timeSlotInUse>");
}
// col for 'insert' and 'delete' requests
out.print(" <span id=time_slot_" + dts_slot_index + "_A class=cellDataB style=\"cursor: default; left: " + col_start[1] + "px; width: " + col_width[1] + "px; background-color: #FFFFFF\">");
j++; // increment the jump label index (where to jump on page)
out.print("<a name=\"jump" + j + "\"></a>"); // create a jump label for returns
if (in_use == 0 && index >= 0) {
// not in use
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseT+ "&returnCourse=" +course+ "&time=" +time+ "&fb=" +fb+ "&jump=" +j+ "&email=" +emailOpt+ "&first=" +first+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&insert=yes\" title=\"Insert a time slot\" alt=\"Insert a time slot\">");
out.print("<img src=/" +rev+ "/images/dts_newrow.gif width=13 height=13 border=0></a>");
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseT+ "&returnCourse=" +course+ "&time=" +time+ "&fb=" +fb+ "&jump=" +j+ "&email=" +emailOpt+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&delete=yes\" title=\"Delete time slot\" alt=\"Remove time slot\">");
out.print("<img src=/" +rev+ "/images/dts_trash.gif width=13 height=13 border=0></a>");
} else {
// in use
out.print("<img src=/" +rev+ "/images/busy.gif width=32 height=13 border=0 alt=\"Busy\" title=\"Busy\">");
}
out.println("</span>");
// time column
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_time class=cellData hollow=true style=\"left: " + col_start[2] + "px; width: " + col_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_time class=cellData style=\"cursor: default; left: " + col_start[2] + "px; width: " + col_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
}
if (min < 10) {
out.print(hr + ":0" + min + ampm);
} else {
out.print(hr + ":" + min + ampm);
}
out.println("</span>");
//
// Name of Course
//
if (course.equals( "-ALL-" )) { // only display this col if this tee sheet is showing more than one course
for (tmp_i = 0; tmp_i < courseCount; tmp_i++) {
if (courseT.equals(courseA[tmp_i])) break;
}
out.print(" <span id=time_slot_" + dts_slot_index + "_course class=cellDataC style=\"cursor: default; left: " + col_start[3] + "px; width: " + col_width[3] + "px; background-color:" + course_color[tmp_i] + "\">");
if (!courseT.equals("")) { out.print(fitName(courseT)); }
out.println("</span>");
}
//
// Front/Back Indicator (note: do we want to display the FBO popup if it's a shotgun event)
//
if (in_use == 0 && hole.equals("") && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_FB class=cellData onclick=\"showFBO(this)\" value=\""+sfb+"\" style=\"cursor: hand; left: " + col_start[4] + "px; width: " + col_width[4] + "px\">"); // background-color: " +dts_defaultF3Color+ "
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_FB class=cellDataB value=\""+sfb+"\" style=\"cursor: default; left: " + col_start[4] + "px; width: " + col_width[4] + "px\">");
}
out.print(sfb);
out.println("</span>");
//
// Add Player 1
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1 class=cellData drag=true startX="+col_start[5]+" playerSlot=1 style=\"left: " + col_start[5] + "px; width: " + col_width[5] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1 class=cellData startX="+col_start[5]+" playerSlot=1 style=\"cursor: default; left: " + col_start[5] + "px; width: " + col_width[5] + "px\">");
}
if (!player1.equals("")) { out.print(fitName(player1)); }
out.println("</span>");
// Player 1 CW
if ((!player1.equals("")) && (!player1.equalsIgnoreCase( "x" ))) {
dts_tmp = p1cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[6] + "px; width: " + col_width[6] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1_CW class=cellDataB style=\"cursor: default; left: " + col_start[6] + "px; width: " + col_width[6] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 2
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2 class=cellData drag=true startX="+col_start[7]+" playerSlot=2 style=\"left: " + col_start[7] + "px; width: " + col_width[7] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2 class=cellData startX="+col_start[7]+" playerSlot=2 style=\"cursor: default; left: " + col_start[7] + "px; width: " + col_width[7] + "px\">");
}
if (!player2.equals("")) { out.print(fitName(player2)); }
out.println(" </span>");
// Player 2 CW
if ((!player2.equals("")) && (!player2.equalsIgnoreCase( "x" ))) {
dts_tmp = p2cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[8] + "px; width: " + col_width[8] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2_CW class=cellDataB style=\"cursor: default; left: " + col_start[8] + "px; width: " + col_width[8] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 3
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3 class=cellData drag=true startX="+col_start[9]+" playerSlot=3 style=\"left: " + col_start[9] + "px; width: " + col_width[9] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3 class=cellData startX="+col_start[9]+" playerSlot=3 style=\"cursor: default; left: " + col_start[9] + "px; width: " + col_width[9] + "px\">");
}
if (!player3.equals("")) { out.print(fitName(player3)); }
out.println("</span>");
// Player 3 CW
if ((!player3.equals("")) && (!player3.equalsIgnoreCase( "x" ))) {
dts_tmp = p3cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[10] + "px; width: " + col_width[10] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3_CW class=cellDataB style=\"cursor: default; left: " + col_start[10] + "px; width: " + col_width[10] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 4
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4 class=cellData drag=true startX="+col_start[11]+" playerSlot=4 style=\"left: " + col_start[11] + "px; width: " + col_width[11] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4 class=cellData startX="+col_start[11]+" playerSlot=4 style=\"cursor: default; left: " + col_start[11] + "px; width: " + col_width[11] + "px\">");
}
if (!player4.equals("")) { out.print(fitName(player4)); }
out.println("</span>");
// Player 4 CW
if ((!player4.equals("")) && (!player4.equalsIgnoreCase( "x" ))) {
dts_tmp = p4cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[12] + "px; width: " + col_width[12] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4_CW class=cellDataB style=\"cursor: default; left: " + col_start[12] + "px; width: " + col_width[12] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 5 if supported
//
if (fivesALL != 0) { // if 5-somes on any course (Paul - this is a new flag!!!!)
if (fives != 0) { // if 5-somes on this course
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData drag=true startX="+col_start[13]+" playerSlot=5 style=\"left: " + col_start[13] + "px; width: " + col_width[13] + "px; background-color: " +bgcolor5+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData startX="+col_start[13]+" playerSlot=5 style=\"cursor: default; left: " + col_start[13] + "px; width: " + col_width[13] + "px\">");
}
if (!player5.equals("")) { out.print(fitName(player5)); }
out.println("</span>");
// Player 5 CW
if ((!player5.equals("")) && (!player5.equalsIgnoreCase( "x" ))) {
dts_tmp = p5cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[14] + "px; width: " + col_width[14] + "px; background-color: " +bgcolor5+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB style=\"cursor: default; left: " + col_start[14] + "px; width: " + col_width[14] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
} else { // 5-somes on at least 1 course, but not this one
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData startX="+col_start[13]+" playerSlot=5 style=\"cursor: default; left: " + col_start[13] + "px; width: " + col_width[13] + "px; background-image: url('/v5/images/shade1.gif')\">");
out.println("</span>");
// Player 5 CW
dts_tmp = "";
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB style=\"cursor: default; left: " + col_start[14] + "px; width: " + col_width[14] + "px; background-image: url('/v5/images/shade1.gif')\">");
out.print(dts_tmp);
out.println("</span>");
} // end if fives
} // end if fivesALL
out.println("</div>"); // end timeslot container div
dts_slot_index++; // increment timeslot index counter
first = "no"; // no longer first time displayed
} // end of IF Blocker that escapes building and displaying a particular tee time slot in the sheet
} // end of while
out.println("<br>"); // spacer at bottom of tee sheet
out.println("\n</div>"); // end main container div holding entire tee sheet
out.println("<!-- END OF TEE SHEET BODY -->\n");
out.println("<br><br>\n");
pstmt.close();
// write out form for posting tee sheet actions to the server for processing
out.println("<form name=frmSendAction method=POST action=/" +rev+ "/servlet/Proshop_dlott>");
out.println("<input type=hidden name=convert value=\"\">");
out.println("<input type=hidden name=index value=\"" + index + "\">");
out.println("<input type=hidden name=returnCourse value=\"" + course + "\">");
out.println("<input type=hidden name=email value=\"" + emailOpt + "\">");
out.println("<input type=hidden name=hide value=\"" + hideUnavail + "\">");
out.println("<input type=hidden name=lott_name value=\"" + lott_name + "\">");
out.println("<input type=hidden name=lotteryId value=\"\">");
out.println("<input type=hidden name=group value=\"\">");
out.println("<input type=hidden name=from_tid value=\"\">");
out.println("<input type=hidden name=to_tid value=\"\">");
out.println("<input type=hidden name=from_course value=\"\">");
out.println("<input type=hidden name=to_course value=\"\">");
out.println("<input type=hidden name=jump value=\"\">"); // needs to be set in ....js !!!!!
out.println("<input type=hidden name=from_time value=\"\">");
out.println("<input type=hidden name=from_fb value=\"\">");
out.println("<input type=hidden name=to_time value=\"\">");
out.println("<input type=hidden name=to_fb value=\"\">");
out.println("<input type=hidden name=from_player value=\"\">");
out.println("<input type=hidden name=to_player value=\"\">");
out.println("<input type=hidden name=to_from value=\"\">");
out.println("<input type=hidden name=to_to value=\"\">");
out.println("<input type=hidden name=changeAll value=\"\">");
out.println("<input type=hidden name=ninehole value=\"\">");
out.println("</form>");
// START OF FBO POPUP WINDOW //
out.println("<div id=elFBOPopup defaultValue=\"\" style=\"visibility: hidden\" jump=\"\">");
out.println("<table width=100% height=100% border=0 cellpadding=0 cellspacing=2>");
out.println("<form name=frmFBO>");
out.println("<input type=hidden name=jump value=\"\">");
out.println("<tr><td align=center class=smtext><b><u>Make Selection</u></b></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=F name=FBO id=FBO_1><label for=\"FBO_1\">Front</label></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=B name=FBO id=FBO_2><label for=\"FBO_2\">Back</label></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=O name=FBO id=FBO_3><label for=\"FBO_3\">Crossover</label></td></tr>");
out.println("<tr><td align=right><a href=\"javascript: cancelFBOPopup()\" class=smtext>cancel</a> <a href=\"javascript: saveFBOPopup()\" class=smtext>save</a> </td></tr>");
out.println("</form>");
out.println("</table>");
out.println("</div>");
// START OF TRANSPORTATION POPUP WINDOW //
//
// Note: There can now be up to 16 dynamic Modes of Transportation (proshop can config).
// Both the Full Name/Description and the Acronym are specified by the pro.
// These names and acronyms will not contain the '9' to indicate 9 holes.
// These values can be found in:
//
// parmc.tmode[i] = full name description
// parmc.tmodea[i] = 1 to 3 character acronym (i = index of 0 - 15)
//
//
out.println("<div id=elTOPopup defaultValue=\"\" fb=\"\" nh=\"\" jump=\"\">");
out.println("<table width=100% height=100% border=0 cellpadding=0 cellspacing=2>");
out.println("<form name=frmTransOpt>");
out.println("<input type=hidden name=jump value=\"\">");
// loop thru the array and write out a table row for each option
// set tmp_cols to the # of cols this table will have
// if the # of trans opts is less then 4 then that's the #, otherwise the max is 4
// tmode_limit = max number of tmodes available
// tmode_count = actual number of tmodes specified for this course
int tmp_cols = 0;
if (parmc.tmode_count < 4) {
tmp_cols = parmc.tmode_count;
} else {
tmp_cols = 4;
}
int tmp_count = 0;
out.println("<tr><td align=center class=smtext colspan="+tmp_cols+"><b><u>Make Selection</u></b></td></tr>");
out.println("<tr>");
for (int tmp_loop = 0; tmp_loop < parmc.tmode_limit; tmp_loop++) {
if (!parmc.tmodea[tmp_loop].equals( "" ) && !parmc.tmodea[tmp_loop].equals( null )) {
out.println("<td nowrap class=smtext><input type=radio value="+parmc.tmodea[tmp_loop]+" name=to id=to_"+tmp_loop+"><label for=\"to_"+tmp_loop+"\">"+parmc.tmode[tmp_loop]+"</label></td>");
if (tmp_count == 3 || tmp_count == 7 || tmp_count == 11) {
out.println("</tr><tr>"); // new row
}
tmp_count++;
}
}
out.println("</tr>");
out.println("<tr><td bgcolor=black colspan="+tmp_cols+"><img src=/" +rev+ "/images/shim.gif width=100 height=1 border=0></td></tr>");
out.println("<tr><td class=smtext colspan="+tmp_cols+"><input type=checkbox value=yes name=9hole id=nh><label for=\"nh\">9 Hole</label></td></tr>");
out.println("<tr><td bgcolor=black colspan="+tmp_cols+"><img src=/" +rev+ "/images/shim.gif width=100 height=1 border=0></td></tr>");
// "CHANGE ALL" DEFAULT OPTION COULD BE SET HERE
out.println("<tr><td class=smtext colspan="+tmp_cols+"><input type=checkbox value=yes name=changeAll id=ca><label for=\"ca\">Change All</label></td></tr>");
out.println("<tr><td align=right colspan="+tmp_cols+"><a href=\"javascript: cancelTOPopup()\" class=smtext>cancel</a> <a href=\"javascript: saveTOPopup()\" class=smtext>save</a> </td></tr>");
out.println("</form>");
out.println("</table>");
out.println("</div>");
// FINAL JAVASCRIPT FOR THE PAGE, SET VARIABLES THAT WE DIDN'T KNOW TILL AFTER PROCESSING
out.println("<script type=\"text/javascript\">");
//out.println("/*if (document.getElementById(\"time_slot_0\")) {");
//out.println(" slotHeight = document.getElementById(\"time_slot_0\").offsetHeight;");
//out.println("} else if (document.getElementById(\"time_slot_0\")) {");
//out.println(" slotHeight = document.getElementById(\"lottery_slot_0\").offsetHeight;");
//out.println("}*/");
out.println("var slotHeight = 20;");
out.println("var g_markerY = document.getElementById(\"imgMarker\").offsetTop;");
out.println("var g_markerX = document.getElementById(\"imgMarker\").offsetLeft;");
out.println("var totalTimeSlots = " + (dts_slot_index) + ";");
out.println("var totalLotterySlots = " + (total_lottery_slots) + ";");
out.println("var g_transOptTotal = " + tmp_count + ";");
out.println("var g_pslot1s = " + col_start[5] + ";");
out.println("var g_pslot1e = " + col_start[6] + ";");
out.println("var g_pslot2s = " + col_start[7] + ";");
out.println("var g_pslot2e = " + col_start[8] + ";");
out.println("var g_pslot3s = " + col_start[9] + ";");
out.println("var g_pslot3e = " + col_start[10] + ";");
out.println("var g_pslot4s = " + col_start[11] + ";");
out.println("var g_pslot4e = " + col_start[12] + ";");
out.println("var g_pslot5s = " + col_start[13] + ";");
out.println("var g_pslot5e = " + col_start[14] + ";");
// SIZE UP THE CONTAINER ELEMENTS AND THE TIME SLOTS
out.println("var e = document.getElementById('widthMarker');");
out.println("var g_slotWidth = e.offsetLeft + e.offsetWidth;");
out.println("var e2 = document.getElementById('widthMarker2');");
out.println("var g_lotterySlotWidth = e2.offsetLeft + e2.offsetWidth;");
out.println("document.styleSheets[0].rules(0).style.width = (g_slotWidth + 2) + 'px';"); // elHContainer
out.println("document.styleSheets[0].rules(1).style.width = (g_slotWidth + 2) + 'px';"); // elContainer
out.println("document.styleSheets[0].rules(7).style.width = g_slotWidth + 'px';"); // header
out.println("document.styleSheets[0].rules(8).style.width = g_slotWidth + 'px';"); // timeslot
out.println("document.styleSheets[0].rules(10).style.width = g_lotterySlotWidth + 'px';"); // lotterySlot
out.println("document.styleSheets[0].rules(12).style.width = (g_lotterySlotWidth + 2) + 'px';"); // elHContainer2
out.println("document.styleSheets[0].rules(13).style.width = (g_lotterySlotWidth + 2) + 'px';"); // elContainer2
int tmp_offset1 = (total_lottery_slots == 0) ? 0 : (total_lottery_slots * 20) + 2; // height of lottery container
int tmp_offset2 = (dts_slot_index == 0) ? 0 : (dts_slot_index * 20) + 2; // height of tee sheet container
int tmp_offset3 = (total_lottery_slots == 0) ? 0 : 24; // 24 is height of header
int tmp_offset4 = 24; // 24 is height of header
int tmp_offset5 = (total_lottery_slots == 0) ? 40 : 80;
// REPOSITION THE CONTAINERS TO THE MARKER
out.println("document.getElementById(\"elHContainer2\").style.top=g_markerY;");
out.println("document.getElementById(\"elHContainer2\").style.left=g_markerX;");
out.println("document.getElementById(\"elContainer2\").style.top=g_markerY+22;");
out.println("document.getElementById(\"elContainer2\").style.left=g_markerX;");
if (total_lottery_slots == 0) {
out.println("document.getElementById(\"elContainer2\").style.visibility = \"hidden\";");
out.println("document.getElementById(\"elHContainer2\").style.visibility = \"hidden\";");
out.println("document.getElementById(\"elContainer2\").style.height = \"0px\";");
out.println("document.getElementById(\"elHContainer2\").style.height = \"0px\";");
} else {
// CALL THE POSITIONING CODE FOR EACH OF LOTTERY SLOTS WE CREATED
out.println("for(x=0;x<=totalLotterySlots-1;x++) eval(\"positionElem('lottery_slot_\" + x + \"', \"+ x +\")\");");
out.println("document.getElementById(\"elContainer2\").style.height=\"" + tmp_offset1 + "px\";");
}
// POSITION THE LEGENDS
out.println("document.getElementById(\"tblLegend\").style.top=g_markerY + " + (tmp_offset1 + (tmp_offset3 * 2)) + ";");
out.println("document.getElementById(\"tblLegend\").style.width=g_slotWidth;");
//out.println("document.getElementById(\"tblLottLegend\").style.top=g_markerY;");
//out.println("document.getElementById(\"tblLottLegend\").style.width=g_slotWidth;");
// POSITION THE TEE SHEET CONTAINER
out.println("document.getElementById(\"elContainer\").style.top=(g_markerY + " + (tmp_offset1 + tmp_offset4 + tmp_offset5) + ");");
out.println("document.getElementById(\"elHContainer\").style.top=(g_markerY + " + (tmp_offset1 + tmp_offset5) + ");");
if (dts_slot_index == 0) {
out.println("document.getElementById(\"elContainer\").style.visibility = \"hidden\";");
} else {
// CALL THE POSITIONING CODE FOR EACH OF THE TIME SLOTS WE CREATED
out.println("for(x=0;x<=totalTimeSlots-1;x++) eval(\"positionElem('time_slot_\" + x + \"', \"+ x +\")\");");
out.println("document.getElementById(\"elContainer\").style.height=\"" + tmp_offset2 + "px\";");
}
out.println("</script>");
out.println("<script type=\"text/javascript\">");
out.println("function checkCourse() {");
out.println(" var f = document.getElementById(\"frmSendAction\").returnCourse;");
out.println(" if (f.value == \"-ALL-\") {");
out.println(" alert(\"You must select a specific course before going back.\\nYou are currently viewing ALL courses for this day.\");");
out.println(" return false;");
out.println(" }");
out.println(" return true;");
out.println("}");
out.println("function convert(lottid) {");
out.println(" f = document.getElementById('frmSendAction');");
out.println(" f.lotteryId.value = lottid;");
out.println(" f.convert.value = 'auto';");
out.println(" f.submit();");
//out.println(" alert(f.action);");
out.println("}");
out.println("</script>");
// END OF OUT FINAL CLIENT SIDE SCRIPT WRITING
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H1>Database Access Error</H1>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>Error = " +errMsg);
out.println("<BR><BR>Exception = " + e1.getMessage());
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// End of HTML page
//
out.println("<p> </p>");
out.println("</body>\n</html>");
out.close();
} // end of doGet
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
HttpSession session = SystemUtils.verifyPro(req, out); // check for intruder
if (session == null) return;
Connection con = SystemUtils.getCon(session); // get DB connection
if (con == null) {
out.println(SystemUtils.HeadTitle("DB Connection Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>Database Connection Error</H3>");
out.println("<BR><BR>Unable to connect to the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// Handle the conversion of notifications to teecurr2 entries
//
if (req.getParameter("convert") != null) {
if (req.getParameter("convert").equals("yes")) {
convert(req, out, con, session, resp);
return;
} else if (req.getParameter("convert").equals("auto")) {
auto_convert(req, out, con, session, resp);
return;
} else if (req.getParameter("convert").equals("all")) {
convert_all(req, out, con, session, resp);
return;
}
}
//
// parm block to hold the tee time parms
//
parmSlot slotParms = new parmSlot(); // allocate a parm block
String changeAll = "";
String ninehole = "";
String dts_tmp = "";
String prompt = "";
int skip = 0;
long date = 0;
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// Get this session's username (to be saved in teecurr)
//
slotParms.user = (String)session.getAttribute("user");
slotParms.club = (String)session.getAttribute("club");
try {
//
// Get the parms passed
//
slotParms.jump = req.getParameter("jump"); // anchor link for page loading
String indexs = req.getParameter("index"); // # of days ahead of current day
slotParms.ind = Integer.parseInt(indexs); // save index value in parm block
String lott_name = req.getParameter("lott_name"); // lottery name
slotParms.lottery = lott_name;
//
// Get the optional parms
//
if (req.getParameter("email") != null) {
slotParms.sendEmail = req.getParameter("email");
} else {
slotParms.sendEmail = "yes";
}
if (req.getParameter("returnCourse") != null) {
slotParms.returnCourse = req.getParameter("returnCourse");
} else {
slotParms.returnCourse = "";
}
if (req.getParameter("from_course") != null) {
slotParms.from_course = req.getParameter("from_course");
} else {
slotParms.from_course = "";
}
if (req.getParameter("to_course") != null) {
slotParms.to_course = req.getParameter("to_course");
} else {
slotParms.to_course = "";
}
if (req.getParameter("from_player") != null) {
dts_tmp = req.getParameter("from_player");
if (!dts_tmp.equals( "" )) {
slotParms.from_player = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_player") != null) {
dts_tmp = req.getParameter("to_player");
if (!dts_tmp.equals( "" )) {
slotParms.to_player = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("from_time") != null) {
dts_tmp = req.getParameter("from_time");
if (!dts_tmp.equals( "" )) {
slotParms.from_time = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_time") != null) {
dts_tmp = req.getParameter("to_time");
if (!dts_tmp.equals( "" )) {
slotParms.to_time = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_from") != null) {
slotParms.to_from = req.getParameter("to_from");
}
if (req.getParameter("to_to") != null) {
slotParms.to_to = req.getParameter("to_to");
}
if (req.getParameter("changeAll") != null) {
changeAll = req.getParameter("changeAll");
}
if (req.getParameter("ninehole") != null) {
ninehole = req.getParameter("ninehole");
}
if (req.getParameter("prompt") != null) { // if 2nd entry (return from prompt)
prompt = req.getParameter("prompt");
dts_tmp = req.getParameter("date");
if (!dts_tmp.equals( "" )) {
date = Integer.parseInt(dts_tmp);
}
dts_tmp = req.getParameter("to_fb");
if (!dts_tmp.equals( "" )) {
slotParms.to_fb = Integer.parseInt(dts_tmp);
}
dts_tmp = req.getParameter("from_fb");
if (!dts_tmp.equals( "" )) {
slotParms.from_fb = Integer.parseInt(dts_tmp);
}
if (req.getParameter("skip") != null) { // if 2nd entry and skip returned
dts_tmp = req.getParameter("skip");
if (!dts_tmp.equals( "" )) {
skip = Integer.parseInt(dts_tmp);
}
}
} else {
if (req.getParameter("from_fb") != null) {
dts_tmp = req.getParameter("from_fb");
// ***************TEMP************
// System.out.println("from_fb = " +dts_tmp);
// ***************TEMP************
slotParms.from_fb = 0;
if (dts_tmp.equals( "B" )) {
slotParms.from_fb = 1;
}
if (dts_tmp.equals( "O" )) {
slotParms.from_fb = 9;
}
}
if (req.getParameter("to_fb") != null) {
dts_tmp = req.getParameter("to_fb");
// ***************TEMP************
// System.out.println("to_fb = " +dts_tmp);
// ***************TEMP************
slotParms.to_fb = 0;
if (dts_tmp.equals( "B" )) {
slotParms.to_fb = 1;
}
if (dts_tmp.equals( "O" )) {
slotParms.to_fb = 9;
}
}
}
} catch (Exception e) {
out.println("Error parsing input variables. " + e.toString());
}
if (date == 0) {
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
if (slotParms.ind > 0) {
cal.add(Calendar.DATE,slotParms.ind); // roll ahead 'index' days
}
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
int day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
slotParms.dd = day;
slotParms.mm = month;
slotParms.yy = year;
slotParms.day = day_table[day_num]; // get name for day
date = (year * 10000) + (month * 100) + day; // create a date field of yyyymmdd
} else {
if (req.getParameter("day") != null) {
slotParms.day = req.getParameter("day");
}
long lyy = date / 10000; // get year
long lmm = (date - (lyy * 10000)) / 100; // get month
long ldd = (date - (lyy * 10000)) - (lmm * 100); // get day
slotParms.dd = (int)ldd;
slotParms.mm = (int)lmm;
slotParms.yy = (int)lyy;
}
//
// determine the type of call: Change F/B, Change C/W, Single Player Move, Whole Tee Time Move
//
if (!slotParms.to_from.equals( "" ) && !slotParms.to_to.equals( "" )) {
changeCW(slotParms, changeAll, ninehole, date, req, out, con, resp); // process Change C/W
return;
}
if (slotParms.to_time == 0) { // if not C/W and no 'to_time' specified
changeFB(slotParms, date, req, out, con, resp); // process Change F/B
return;
}
if ((slotParms.to_player == 0) && (slotParms.from_player == 0)) {
moveWhole(slotParms, date, prompt, skip, req, out, con, resp); // process Move Whole Tee Time
return;
}
if (slotParms.from_player > 0 && slotParms.to_player > 0) {
moveSingle(slotParms, date, prompt, skip, req, out, con, resp); // process Move Single Tee Time
return;
}
//
// If we get here, there is an error
//
out.println(SystemUtils.HeadTitle("Error in Proshop_dlott"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H2>Error While Editing Tee Sheet</H2>");
out.println("<BR><BR>An error has occurred that prevents the system from completing the task.<BR>");
out.println("<BR>Please try again. If problem continues, contact ForeTees.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +slotParms.ind+ "&course=" +slotParms.returnCourse+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
} // end of doPost
//
// returns the player name but enforces a max length for staying in the width allowed
// change the two positive values to control the output
//
private static String fitName(String pName) {
return (pName.length() > 14) ? pName.substring(0, 13) + "..." : pName;
}
private static String getTime(int time) {
try {
String ampm = "AM";
int hr = time / 100;
int min = time % (hr * 100);
if (hr == 12) {
ampm = "PM";
} else if (hr > 12) {
hr -= 12;
ampm = "PM";
}
return hr + ":" + SystemUtils.ensureDoubleDigit(min) + " " + ampm;
} catch (Exception ignore) {
return "N/A";
}
}
private void buildRow(int slotIndex, int group, String course, String course_color, String bgcolor, int max_players, int courseCount, int lcol_start[], int lcol_width[], int index, String emailOpt, int j, String dts_defaultF3Color, boolean child, String hideUnavail, String lott_name, ResultSet rs, PrintWriter out) {
// out.println("<!-- slotIndex=" + slotIndex + ", group=" + group + ", max_players=" + max_players + " -->");
try {
boolean tmp_found2 = false;
boolean moved = false;
String fullName = "";
String player_list = "";
int nineHole = 0;
int x2 = 0; // player data pos in rs
//int sum_players = 0;
for (int x = 0; x <= max_players - 1; x++) {
x2 = x + ((group - 1) * max_players); // position offset
fullName = rs.getString(x2 + 13);
if (fullName.equals("MOVED")) moved = true;
nineHole = rs.getInt(x2 + 137);
//cw = rs.getString(x2 + 63);
//eighteenHole = 1; //rs.getInt(x + );
if (!fullName.equals("")) {
if (tmp_found2) player_list = player_list + (", ");
player_list = player_list + fullName + ((nineHole == 1) ? "<font style=\"font-size:8px\"> (9)</font>" : "");
tmp_found2 = true;
//out.print(fullName + ((nineHole == 1) ? "<font style=\"font-size:8px\"> (9)</font>" : ""));
//sum_players++;
}
}
//
// Start Row
//
out.print("<div id=lottery_slot_"+ slotIndex +" time=\"" + rs.getInt("time") + "\" course=\"" + rs.getString("courseName") + "\" startX=0 startY=0 lotteryId=\"" + rs.getInt("id") + "\" group=\"" + group + "\" ");
if (rs.getInt("in_use") == 0 && !moved) {
// not in use
out.println("class=lotterySlot drag=true style=\"background-color: "+ bgcolor +"\" bgc=\""+ bgcolor +"\">");
} else {
// in use
out.println("class=timeSlotInUse>");
}
//
// Col for 'move' and 'delete' requests
//
out.print(" <span id=lottery_slot_" + slotIndex + "_A class=cellDataB style=\"cursor: default; left: " + lcol_start[1] + "px; width: " + lcol_width[1] + "px; background-color: #FFFFFF\">");
j++; // increment the jump label index (where to jump on page)
out.print("<a name=\"jump" + j + "\"></a>"); // create a jump label for returns
if (rs.getInt("in_use") == 0) {
// not in use
if (!child) {
//out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&lotteryId=" + rs.getInt("id") + "&returnCourse=" +course+ "&email=" +emailOpt+ "&convert=yes\" title=\"Move Request\" alt=\"Move Request\">");
if (rs.getInt("atime1") == 0) {
// unassigned (will need to be dragged to tee sheet)
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
} else {
// had an assigned time
out.print("<a href=\"javascript:convert('" + rs.getInt("id") + "')\" onclick=\"void(0)\" title=\"Move Request\" alt=\"Move Request\">");
out.print("<img src=/" +rev+ "/images/dts_move.gif width=13 height=13 border=0></a>");
}
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&lotteryId=" + rs.getInt("id") + "&returnCourse=" +course+ "&email=" +emailOpt+ "&lott_name=" +lott_name+ "&hide=" +hideUnavail+ "&delete=yes\" title=\"Delete Request\" alt=\"Remove Request\" onclick=\"return confirm('Are you sure you want to permanently delete this lottery request?');\">");
out.print("<img src=/" +rev+ "/images/dts_trash.gif width=13 height=13 border=0></a>");
} else {
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
}
} else {
// in use
out.print("<img src=/" +rev+ "/images/busy.gif width=32 height=13 border=0 alt=\"" + rs.getString("in_use_by") + "\" title=\"Busy\">");
}
out.println("</span>");
//
// Assigned Time
//
if (rs.getInt("in_use") == 0 && !moved) {
out.print(" <span id=lottery_slot_" + slotIndex + "_assignTime hollow=true class=cellData style=\"left: " + lcol_start[2] + "px; width: " + lcol_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
//out.print(" <span id=lottery_slot_" + slotIndex + "_time class=cellData style=\"cursor: default; left: " + lcol_start[3] + "px; width: " + lcol_width[3] + "px; background-color: " +dts_defaultF3Color+ "\">");
} else {
out.print(" <span id=lottery_slot_" + slotIndex + "_assignTime class=cellData style=\"cursor: default; left: " + lcol_start[2] + "px; width: " + lcol_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
}
// this could cause a / by zero error is atime has not been assigned yet (done on timer)
switch (group) {
case 1:
if (rs.getInt("atime1") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime1")));
}
break;
case 2:
if (rs.getInt("atime2") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime2")));
}
break;
case 3:
if (rs.getInt("atime3") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime3")));
}
break;
case 4:
if (rs.getInt("atime4") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime4")));
}
break;
case 5:
if (rs.getInt("atime5") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime5")));
}
break;
}
out.print("</span>");
//
// Requested Time
//
out.print(" <span id=lottery_slot_" + slotIndex + "_time class=cellData style=\"cursor: default; left: " + lcol_start[3] + "px; width: " + lcol_width[3] + "px; background-color: " +dts_defaultF3Color+ "\">");
if (!child) out.print(getTime(rs.getInt("time")));
out.print("</span>");
//
// Acceptable Times
//
String ftime = ""; // first acceptable time
String ltime = ""; // last acceptable time
int before = rs.getInt("minsbefore");
int after = rs.getInt("minsafter");
if (before > 0) {
ftime = getTime(SystemUtils.getFirstTime(rs.getInt("time"), before)); // get earliest time for this request
} else {
ftime = getTime(rs.getInt("time"));
}
if (after > 0) {
ltime = getTime(SystemUtils.getLastTime(rs.getInt("time"), after)); // get latest time for this request
} else {
ltime = getTime(rs.getInt("time"));
}
out.print(" <span id=lottery_slot_" + slotIndex + "_oktimes class=cellData style=\"cursor: default; left: " + lcol_start[4] + "px; width: " + lcol_width[4] + "px; background-color: " +dts_defaultF3Color+ "\">");
if (!child && !ftime.equals("")) out.print(ftime + " - " + ltime);
out.print("</span>");
//
// Course
//
if (course.equals( "-ALL-" )) { // only display this col if multi course club
out.print("<span id=lottery_slot_" + slotIndex + "_course class=cellDataC style=\"cursor: default; left: " + lcol_start[5] + "px; width: " + lcol_width[5] + "px; background-color:" + course_color + "\">");
if (!rs.getString("courseName").equals("")) { out.print(fitName(rs.getString("courseName"))); }
out.print("</span>");
}
//
// Weight
//
out.print(" <span id=lottery_slot_" + slotIndex + "_weight class=cellData style=\"cursor: default; left: " + lcol_start[6] + "px; width: " + lcol_width[6] + "px;\">");
out.print(rs.getInt("weight"));
out.print("</span>");
//
// Players
//
out.print("<span id=lottery_slot_" + slotIndex + "_members class=cellDataB value=\"\" style=\"cursor: default; left: " + lcol_start[7] + "px; width: " + lcol_width[7] + "px; text-align: left\"> ");
if (child) out.println(" » ");
//if (child) out.println("<span style=\"position: relative;text-align: left;\"><img src=\"/" +rev+ "/images/dts_child.gif\" width=12 height=12 border=0 valign=top></span>");
out.print(player_list);
if (!rs.getString("notes").equals("")) {
// this won't work in rl but is meant to show a dynamic popup, or we can spawn a small popup window that will show the notes
out.println(" <img src=\"/"+rev+"/images/notes.gif\" width=10 height=12 border=0 alt=\"" + rs.getString("notes") + "\">");
}
out.print("</span>");
/*
out.print("<span class=cellDataB style=\"cursor: default; left: " + lcol_start[6] + "px; width: " + lcol_width[6] + "px\">");
out.print(sum_players);
out.println("</span>");
out.print("<span class=cellDataB style=\"cursor: default; left: " + lcol_start[7] + "px; width: " + lcol_width[7] + "px\">");
*/
//out.print(((nineHole == 0) ? "18" : "9"));
/*
*
if (nineHole == 1 && eighteenHole == 1) {
out.print("mixed");
} else if (nineHole == 1) {
out.print("9");
} else if (eighteenHole == 1) {
out.print("18");
}
*/
out.println("</span>");
out.println("</div>");
} catch (SQLException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
//out.println("</div>");
}
}
private void convert_all(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
}
private void convert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
Statement stmt = null;
ResultSet rs = null;
//
// Get this session's attributes
//
String user = "";
String club = "";
user = (String)session.getAttribute("user");
club = (String)session.getAttribute("club");
int index = 0;
int fives = 0; // for tee time we are dragging to
int count = 0;
int group = 0;
int lottery_id = 0;
int teecurr_id = 0;
boolean overRideFives = false;
String hideUnavail = req.getParameter("hide");
if (hideUnavail == null) hideUnavail = "";
String sindex = req.getParameter("index"); // day index value (needed by _sheet on return)
String returnCourse = req.getParameter("returnCourse"); // name of course to return to (multi)
String suppressEmails = "no";
String slid = "";
String stid = "";
String sgroup = "";
if (req.getParameter("to_tid") != null) stid = req.getParameter("to_tid");
if (req.getParameter("lotteryId") != null) slid = req.getParameter("lotteryId");
if (req.getParameter("group") != null) sgroup = req.getParameter("group");
String convert = req.getParameter("convert");
if (convert == null) convert = "";
String lott_name = req.getParameter("lott_name");
if (lott_name == null) lott_name = "";
if (req.getParameter("overRideFives") != null && req.getParameter("overRideFives").equals("yes")) {
overRideFives = true;
}
if (req.getParameter("suppressEmails") != null) { // if email parm exists
suppressEmails = req.getParameter("suppressEmails");
}
//
// parm block to hold the tee time parms
//
parmSlot slotParms = new parmSlot(); // allocate a parm block
/*
if (convert.equals("auto")) {
// lookup the teecurr_id from the date/time/fb/course that was assigned for this request
try {
PreparedStatement pstmt = con.prepareStatement("" +
"SELECT t.teecurr_id " +
"FROM teecurr2 t, lreqs3 l " +
"WHERE l.id = ? AND l.courseName = t.courseName AND l.atime1 = t.time AND l.afb = t.fb " +
"LIMIT 1");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) teecurr_id = rs.getInt(1);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
} else {
*/
//
// Convert the values from string to int
//
try {
lottery_id = Integer.parseInt(slid);
teecurr_id = Integer.parseInt(stid);
group = Integer.parseInt(sgroup);
index = Integer.parseInt(sindex);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
}
//
// Get fives value for this course (from teecurr_id)
//
if (!overRideFives) {
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 c, teecurr2 t " +
"WHERE c.courseName = t.courseName AND t.teecurr_id = ?");
pstmtc.clearParameters();
pstmtc.setInt(1, teecurr_id);
rs = pstmtc.executeQuery();
if (rs.next()) fives = rs.getInt("fives");
pstmtc.close();
}
catch (Exception e) {
}
} else {
fives = 1;
}
slotParms.ind = index; // index value
slotParms.club = club; // name of club
slotParms.returnCourse = returnCourse; // name of course for return to _sheet
slotParms.suppressEmails = suppressEmails;
//
// Load parameter object
//
try {
PreparedStatement pstmt = con.prepareStatement("SELECT * FROM teecurr2 WHERE teecurr_id = ?");
pstmt.clearParameters();
pstmt.setInt(1, teecurr_id);
rs = pstmt.executeQuery();
if (rs.next()) {
slotParms.player1 = rs.getString("player1");
slotParms.player2 = rs.getString("player2");
slotParms.player3 = rs.getString("player3");
slotParms.player4 = rs.getString("player4");
slotParms.player5 = rs.getString("player5");
slotParms.user1 = rs.getString("username1");
slotParms.user2 = rs.getString("username2");
slotParms.user3 = rs.getString("username3");
slotParms.user4 = rs.getString("username4");
slotParms.user5 = rs.getString("username5");
slotParms.p1cw = rs.getString("p1cw");
slotParms.p2cw = rs.getString("p2cw");
slotParms.p3cw = rs.getString("p3cw");
slotParms.p4cw = rs.getString("p4cw");
slotParms.p5cw = rs.getString("p5cw");
slotParms.in_use = rs.getInt("in_use");
slotParms.in_use_by = rs.getString("in_use_by");
slotParms.userg1 = rs.getString("userg1");
slotParms.userg2 = rs.getString("userg2");
slotParms.userg3 = rs.getString("userg3");
slotParms.userg4 = rs.getString("userg4");
slotParms.userg5 = rs.getString("userg5");
slotParms.orig_by = rs.getString("orig_by");
slotParms.pos1 = rs.getShort("pos1");
slotParms.pos2 = rs.getShort("pos2");
slotParms.pos3 = rs.getShort("pos3");
slotParms.pos4 = rs.getShort("pos4");
slotParms.pos5 = rs.getShort("pos5");
slotParms.rest5 = rs.getString("rest5");
}
out.println("<!-- DONE LOADING slotParms WITH teecurr2 DATA -->");
pstmt.close();
}
catch (Exception e) {
out.println("<p>Error: "+e.toString()+"</p>");
}
// make sure there are enough open player slots
int max_group_size = (fives == 0 || slotParms.p5.equalsIgnoreCase("No")) ? 4 : 5;
int open_slots = 0;
boolean has_players = false;
if (slotParms.player1.equals("")) { open_slots++; } else { has_players = true; }
if (slotParms.player2.equals("")) open_slots++;
if (slotParms.player3.equals("")) open_slots++;
if (slotParms.player4.equals("")) open_slots++;
if (slotParms.player5.equals("") && slotParms.rest5.equals("") && fives == 1 && slotParms.p5.equalsIgnoreCase("Yes")) open_slots++;
if (slotParms.orig_by.equals( "" )) { // if originator field still empty (allow this person to grab this tee time again)
slotParms.orig_by = user; // set this user as the originator
}
out.println("<!-- open_slots="+open_slots+" | has_players="+has_players+" -->");
//
// Check in-use indicators
//
if (slotParms.in_use == 1 && !slotParms.in_use_by.equalsIgnoreCase( user )) { // if time slot in use and not by this user
out.println(SystemUtils.HeadTitle("DB Record In Use Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H1>Reservation Timer Expired</H1>");
out.println("<BR><BR>Sorry, but this tee time slot has been returned to the system!<BR>");
out.println("<BR>The system timed out and released the tee time.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + index + ">");
if (!returnCourse.equals( "" )) { // if multi course club, get course to return to (ALL?)
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
} else {
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.course + "\">");
}
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
boolean teeTimeFull = false;
boolean allowFives = (fives == 1) ? true : false; // does the course we are dragging to allow 5-somes?
String fields = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int groups = 0;
int group_size = 0;
int group_players = 0;
int tmp_added = 0;
int field_offset = 0;
//
// Load lottery request data
//
try {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT l.*, c.fives " +
"FROM lreqs3 l, clubparm2 c " +
"WHERE id = ? AND l.courseName = c.courseName;");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) {
groups = rs.getInt("groups");
group_size = (rs.getInt("fives") == 0 || !rs.getString("p5").equalsIgnoreCase("Yes")) ? 4 : 5;
field_offset = (group - 1) * group_size; // player data pos in rs
player1 = rs.getString(12 + field_offset);
player2 = rs.getString(13 + field_offset);
player3 = rs.getString(14 + field_offset);
player4 = rs.getString(15 + field_offset);
player5 = rs.getString(16 + field_offset);
user1 = rs.getString(37 + field_offset);
user2 = rs.getString(38 + field_offset);
user3 = rs.getString(39 + field_offset);
user4 = rs.getString(40 + field_offset);
user5 = rs.getString(41 + field_offset);
p1cw = rs.getString(62 + field_offset);
p2cw = rs.getString(63 + field_offset);
p3cw = rs.getString(64 + field_offset);
p4cw = rs.getString(65 + field_offset);
p5cw = rs.getString(66 + field_offset);
userg1 = rs.getString(109 + field_offset);
userg2 = rs.getString(110 + field_offset);
userg3 = rs.getString(111 + field_offset);
userg4 = rs.getString(112 + field_offset);
userg5 = rs.getString(113 + field_offset);
p91 = rs.getInt(136 + field_offset);
p92 = rs.getInt(137 + field_offset);
p93 = rs.getInt(138 + field_offset);
p94 = rs.getInt(139 + field_offset);
p95 = rs.getInt(140 + field_offset);
}
if (!player1.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player1, user1, p1cw, p91, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player2.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player2, user2, p2cw, p92, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player3.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player3, user3, p3cw, p93, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player4.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player4, user4, p4cw, p94, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player5.equals("") && allowFives && group_size == 5) {
group_players++;
teeTimeFull = addPlayer(slotParms, player5, user5, p5cw, p95, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
} catch(Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
//return;
}
// Let see if all players from this request where moved
if ( teeTimeFull || tmp_added == 0 ) {
out.println(SystemUtils.HeadTitle("Unable to Add All Players"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Unable to Add All Players</H3><BR>");
out.println("<BR>Sorry we were not able to add all the players to this tee time.<br><br>");
out.println("<BR><BR>No changes were made to the lottery request or tee sheet.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"submit\" value=\"Try Again\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
out.println("<!-- field_offset=" + field_offset + " -->");
out.println("<!-- group=" + group + " | max_group_size=" + max_group_size + " -->");
out.println("<!-- groups=" + groups + " | group_size=" + group_size + " | group_players=" + group_players + " -->");
out.println("<!-- lottery_id="+lottery_id+" | teecurr_id="+teecurr_id+" | tmp_added="+tmp_added+" -->");
// first lets see if they are trying to fill the 5th player slot when it is unavailable for this course
if ( !slotParms.player5.equals("") && fives == 0 ) { // ( (!slotParms.rest5.equals("") && overRideFives == false) || fives == 0)
out.println(SystemUtils.HeadTitle("5-some Restricted - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are not allowed on this course.<br><br>");
out.println("<BR><BR>Please move the lottery request to another course.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"submit\" value=\"Try Again\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
/*
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"convert\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"overRideFives\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"lotteryId\" value=\"" + lottery_id + "\">");
out.println("<input type=\"hidden\" name=\"to_tid\" value=\"" + teecurr_id + "\">");
out.println("<input type=\"hidden\" name=\"group\" value=\"" + group + "\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
*/
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} // end 5-some rejection
//
// Update entry in teecurr2
//
try {
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, notes = ?, hideNotes = ?, proNew = ?, proMod = ?, " +
"mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, conf = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ?, pos1 = ?, pos2 = ?, pos3 = ?, pos4 = ?, pos5 = ? " +
"WHERE teecurr_id = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, slotParms.player1);
pstmt6.setString(2, slotParms.player2);
pstmt6.setString(3, slotParms.player3);
pstmt6.setString(4, slotParms.player4);
pstmt6.setString(5, slotParms.user1);
pstmt6.setString(6, slotParms.user2);
pstmt6.setString(7, slotParms.user3);
pstmt6.setString(8, slotParms.user4);
pstmt6.setString(9, slotParms.p1cw);
pstmt6.setString(10, slotParms.p2cw);
pstmt6.setString(11, slotParms.p3cw);
pstmt6.setString(12, slotParms.p4cw);
pstmt6.setFloat(13, slotParms.hndcp1);
pstmt6.setFloat(14, slotParms.hndcp2);
pstmt6.setFloat(15, slotParms.hndcp3);
pstmt6.setFloat(16, slotParms.hndcp4);
pstmt6.setString(17, slotParms.player5);
pstmt6.setString(18, slotParms.user5);
pstmt6.setString(19, slotParms.p5cw);
pstmt6.setFloat(20, slotParms.hndcp5);
pstmt6.setString(21, slotParms.notes);
pstmt6.setInt(22, 0); // hide
pstmt6.setInt(23, 0); // proNew
pstmt6.setInt(24, 0); // proMod
pstmt6.setString(25, slotParms.mNum1);
pstmt6.setString(26, slotParms.mNum2);
pstmt6.setString(27, slotParms.mNum3);
pstmt6.setString(28, slotParms.mNum4);
pstmt6.setString(29, slotParms.mNum5);
pstmt6.setString(30, slotParms.userg1);
pstmt6.setString(31, slotParms.userg2);
pstmt6.setString(32, slotParms.userg3);
pstmt6.setString(33, slotParms.userg4);
pstmt6.setString(34, slotParms.userg5);
pstmt6.setString(35, slotParms.orig_by);
pstmt6.setString(36, slotParms.conf);
pstmt6.setInt(37, slotParms.p91);
pstmt6.setInt(38, slotParms.p92);
pstmt6.setInt(39, slotParms.p93);
pstmt6.setInt(40, slotParms.p94);
pstmt6.setInt(41, slotParms.p95);
pstmt6.setInt(42, slotParms.pos1);
pstmt6.setInt(43, slotParms.pos2);
pstmt6.setInt(44, slotParms.pos3);
pstmt6.setInt(45, slotParms.pos4);
pstmt6.setInt(46, slotParms.pos5);
pstmt6.setInt(47, teecurr_id);
count = pstmt6.executeUpdate(); // execute the prepared stmt
}
catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
// if the tee time was updated then remove the request
if (count == 1) {
// depending on how many groups this request had, we'll either delete or modify the request
if (groups == 1) {
// there was one group in the request - just delete the request
try {
PreparedStatement pstmt = con.prepareStatement("DELETE FROM lreqs3 WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
} else {
// there were multiple groups in this request, lets mark the specific group
int tmp_pos = 0;
int tmp = 0;
int tmp_loop = 1;
// get the position of the first player for the group we moved
if (group == 1)
{ tmp_pos = 0; }
else
{ tmp_pos = group_size * (group - 1); }
// build the fields string for the sql statement
for (tmp = tmp_pos; tmp <= tmp_pos + group_size; tmp++) {
if (tmp_loop > tmp_added) break;
fields = fields + " player" + (tmp + 1) + " = 'MOVED',";
tmp_loop++;
}
// trim trailing comma
fields=fields.substring(0, fields.length() - 1);
out.println("<!-- tmp_pos=" + tmp_pos + " -->");
out.println("<!-- fields=" + fields + " -->");
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE lreqs3 SET " + fields + " WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
// now check all the players in this request and if they equal 'MOVED' then we can delete this request
try {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT * FROM lreqs3 WHERE id = ? AND " +
"(player1 = 'MOVED' OR player1 = '') AND " +
"(player2 = 'MOVED' OR player2 = '') AND " +
"(player3 = 'MOVED' OR player3 = '') AND " +
"(player4 = 'MOVED' OR player4 = '') AND " +
"(player5 = 'MOVED' OR player5 = '') AND " +
"(player6 = 'MOVED' OR player6 = '') AND " +
"(player7 = 'MOVED' OR player7 = '') AND " +
"(player8 = 'MOVED' OR player8 = '') AND " +
"(player9 = 'MOVED' OR player9 = '') AND " +
"(player10 = 'MOVED' OR player10 = '') AND " +
"(player11 = 'MOVED' OR player11 = '') AND " +
"(player12 = 'MOVED' OR player12 = '') AND " +
"(player13 = 'MOVED' OR player13 = '') AND " +
"(player14 = 'MOVED' OR player14 = '') AND " +
"(player15 = 'MOVED' OR player15 = '') AND " +
"(player16 = 'MOVED' OR player16 = '') AND " +
"(player17 = 'MOVED' OR player17 = '') AND " +
"(player18 = 'MOVED' OR player18 = '') AND " +
"(player19 = 'MOVED' OR player19 = '') AND " +
"(player20 = 'MOVED' OR player20 = '') AND " +
"(player21 = 'MOVED' OR player21 = '') AND " +
"(player22 = 'MOVED' OR player22 = '') AND " +
"(player23 = 'MOVED' OR player23 = '') AND " +
"(player24 = 'MOVED' OR player24 = '') AND " +
"(player25 = 'MOVED' OR player25 = '');");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) {
pstmt = con.prepareStatement("DELETE FROM lreqs3 WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
}
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
}
} // end if updated teecurr2 entry
out.println("<!-- count="+count+" -->");
out.println("<!-- ");
out.println("slotParms.player1=" + slotParms.player1);
out.println("slotParms.player2=" + slotParms.player2);
out.println("slotParms.player3=" + slotParms.player3);
out.println("slotParms.player4=" + slotParms.player4);
out.println("slotParms.player5=" + slotParms.player5);
out.println("");
out.println("slotParms.p1cw=" + slotParms.p1cw);
out.println("slotParms.p2cw=" + slotParms.p2cw);
out.println("slotParms.p3cw=" + slotParms.p3cw);
out.println("slotParms.p4cw=" + slotParms.p4cw);
out.println("slotParms.p5cw=" + slotParms.p5cw);
out.println("");
out.println("slotParms.p91=" + slotParms.p91);
out.println("slotParms.p92=" + slotParms.p92);
out.println("slotParms.p93=" + slotParms.p93);
out.println("slotParms.p94=" + slotParms.p94);
out.println("slotParms.p95=" + slotParms.p95);
out.println("");
out.println("slotParms.mNum1=" + slotParms.mNum1);
out.println("slotParms.mNum2=" + slotParms.mNum2);
out.println("slotParms.mNum3=" + slotParms.mNum3);
out.println("slotParms.mNum4=" + slotParms.mNum4);
out.println("slotParms.mNum5=" + slotParms.mNum5);
out.println("");
out.println(" -->");
//
// Completed update - reload page
//
out.println("<meta http-equiv=\"Refresh\" content=\"2; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&lott_name=" + lott_name + "&hide="+hideUnavail+"\">");
out.close();
return;
}
private void auto_convert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
Statement estmt = null;
Statement stmtN = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtd = null;
PreparedStatement pstmtd2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
String course = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String player6 = "";
String player7 = "";
String player8 = "";
String player9 = "";
String player10 = "";
String player11 = "";
String player12 = "";
String player13 = "";
String player14 = "";
String player15 = "";
String player16 = "";
String player17 = "";
String player18 = "";
String player19 = "";
String player20 = "";
String player21 = "";
String player22 = "";
String player23 = "";
String player24 = "";
String player25 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String p6cw = "";
String p7cw = "";
String p8cw = "";
String p9cw = "";
String p10cw = "";
String p11cw = "";
String p12cw = "";
String p13cw = "";
String p14cw = "";
String p15cw = "";
String p16cw = "";
String p17cw = "";
String p18cw = "";
String p19cw = "";
String p20cw = "";
String p21cw = "";
String p22cw = "";
String p23cw = "";
String p24cw = "";
String p25cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String user6 = "";
String user7 = "";
String user8 = "";
String user9 = "";
String user10 = "";
String user11 = "";
String user12 = "";
String user13 = "";
String user14 = "";
String user15 = "";
String user16 = "";
String user17 = "";
String user18 = "";
String user19 = "";
String user20 = "";
String user21 = "";
String user22 = "";
String user23 = "";
String user24 = "";
String user25 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String userg6 = "";
String userg7 = "";
String userg8 = "";
String userg9 = "";
String userg10 = "";
String userg11 = "";
String userg12 = "";
String userg13 = "";
String userg14 = "";
String userg15 = "";
String userg16 = "";
String userg17 = "";
String userg18 = "";
String userg19 = "";
String userg20 = "";
String userg21 = "";
String userg22 = "";
String userg23 = "";
String userg24 = "";
String userg25 = "";
String mNum1 = "";
String mNum2 = "";
String mNum3 = "";
String mNum4 = "";
String mNum5 = "";
String color = "";
String p5 = "";
String type = "";
String pref = "";
String approve = "";
String day = "";
String notes = "";
String in_use_by = "";
String orig_by = "";
String parm = "";
String hndcps = "";
String player5T = "";
String user5T = "";
String p5cwT = "";
String errorMsg = "";
String [] userA = new String [25]; // array to hold usernames
long id = 0;
int date = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int p96 = 0;
int p97 = 0;
int p98 = 0;
int p99 = 0;
int p910 = 0;
int p911 = 0;
int p912 = 0;
int p913 = 0;
int p914 = 0;
int p915 = 0;
int p916 = 0;
int p917 = 0;
int p918 = 0;
int p919 = 0;
int p920 = 0;
int p921 = 0;
int p922 = 0;
int p923 = 0;
int p924 = 0;
int p925 = 0;
int i = 0;
int mm = 0;
int dd = 0;
int yy = 0;
int fb = 0;
int afb = 0;
int afb2 = 0;
int afb3 = 0;
int afb4 = 0;
int afb5 = 0;
int count = 0;
int groups = 0;
int time = 0;
int rtime = 0;
int atime1 = 0;
int atime2 = 0;
int atime3 = 0;
int atime4 = 0;
int atime5 = 0;
int players = 0;
int hide = 0;
int proNew = 0;
int proMod = 0;
int memNew = 0;
int memMod = 0;
int proxMins = 0;
short show1 = 0;
short show2 = 0;
short show3 = 0;
short show4 = 0;
short show5 = 0;
float hndcp1 = 99;
float hndcp2 = 99;
float hndcp3 = 99;
float hndcp4 = 99;
float hndcp5 = 99;
boolean ok = true;
int lottery_id = 0;
int index = 0;
String slid = "";
String sindex = req.getParameter("index");
String hideUnavail = req.getParameter("hide");
String returnCourse = req.getParameter("returnCourse"); // name of course to return to (multi)
if (req.getParameter("lotteryId") != null) slid = req.getParameter("lotteryId");
String name = req.getParameter("lott_name");
if (name == null) name = "";
//
// Get the lottery_id
//
try {
lottery_id = Integer.parseInt(slid);
index = Integer.parseInt(sindex);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
try {
errorMsg = "Error in Proshop_dlott:auto_convert (get lottery request): ";
//
// Get the Lottery Requests for the lottery passed
//
pstmt = con.prepareStatement (
"SELECT mm, dd, yy, day, time, " +
"player1, player2, player3, player4, player5, player6, player7, player8, player9, player10, " +
"player11, player12, player13, player14, player15, player16, player17, player18, player19, player20, " +
"player21, player22, player23, player24, player25, " +
"user1, user2, user3, user4, user5, user6, user7, user8, user9, user10, " +
"user11, user12, user13, user14, user15, user16, user17, user18, user19, user20, " +
"user21, user22, user23, user24, user25, " +
"p1cw, p2cw, p3cw, p4cw, p5cw, p6cw, p7cw, p8cw, p9cw, p10cw, " +
"p11cw, p12cw, p13cw, p14cw, p15cw, p16cw, p17cw, p18cw, p19cw, p20cw, " +
"p21cw, p22cw, p23cw, p24cw, p25cw, " +
"notes, hideNotes, fb, proNew, proMod, memNew, memMod, id, groups, atime1, atime2, atime3, " +
"atime4, atime5, afb, p5, players, userg1, userg2, userg3, userg4, userg5, userg6, userg7, userg8, " +
"userg9, userg10, userg11, userg12, userg13, userg14, userg15, userg16, userg17, userg18, userg19, " +
"userg20, userg21, userg22, userg23, userg24, userg25, orig_by, " +
"p91, p92, p93, p94, p95, p96, p97, p98, p99, p910, " +
"p911, p912, p913, p914, p915, p916, p917, p918, p919, p920, " +
"p921, p922, p923, p924, p925, afb2, afb3, afb4, afb5, type, courseName, date " +
"FROM lreqs3 " +
"WHERE id = ? AND state = 2");
pstmt.clearParameters(); // clear the parms
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery(); // execute the prepared stmt again to start with first
while (rs.next()) {
mm = rs.getInt(1);
dd = rs.getInt(2);
yy = rs.getInt(3);
day = rs.getString(4);
rtime = rs.getInt(5);
player1 = rs.getString(6);
player2 = rs.getString(7);
player3 = rs.getString(8);
player4 = rs.getString(9);
player5 = rs.getString(10);
player6 = rs.getString(11);
player7 = rs.getString(12);
player8 = rs.getString(13);
player9 = rs.getString(14);
player10 = rs.getString(15);
player11 = rs.getString(16);
player12 = rs.getString(17);
player13 = rs.getString(18);
player14 = rs.getString(19);
player15 = rs.getString(20);
player16 = rs.getString(21);
player17 = rs.getString(22);
player18 = rs.getString(23);
player19 = rs.getString(24);
player20 = rs.getString(25);
player21 = rs.getString(26);
player22 = rs.getString(27);
player23 = rs.getString(28);
player24 = rs.getString(29);
player25 = rs.getString(30);
user1 = rs.getString(31);
user2 = rs.getString(32);
user3 = rs.getString(33);
user4 = rs.getString(34);
user5 = rs.getString(35);
user6 = rs.getString(36);
user7 = rs.getString(37);
user8 = rs.getString(38);
user9 = rs.getString(39);
user10 = rs.getString(40);
user11 = rs.getString(41);
user12 = rs.getString(42);
user13 = rs.getString(43);
user14 = rs.getString(44);
user15 = rs.getString(45);
user16 = rs.getString(46);
user17 = rs.getString(47);
user18 = rs.getString(48);
user19 = rs.getString(49);
user20 = rs.getString(50);
user21 = rs.getString(51);
user22 = rs.getString(52);
user23 = rs.getString(53);
user24 = rs.getString(54);
user25 = rs.getString(55);
p1cw = rs.getString(56);
p2cw = rs.getString(57);
p3cw = rs.getString(58);
p4cw = rs.getString(59);
p5cw = rs.getString(60);
p6cw = rs.getString(61);
p7cw = rs.getString(62);
p8cw = rs.getString(63);
p9cw = rs.getString(64);
p10cw = rs.getString(65);
p11cw = rs.getString(66);
p12cw = rs.getString(67);
p13cw = rs.getString(68);
p14cw = rs.getString(69);
p15cw = rs.getString(70);
p16cw = rs.getString(71);
p17cw = rs.getString(72);
p18cw = rs.getString(73);
p19cw = rs.getString(74);
p20cw = rs.getString(75);
p21cw = rs.getString(76);
p22cw = rs.getString(77);
p23cw = rs.getString(78);
p24cw = rs.getString(79);
p25cw = rs.getString(80);
notes = rs.getString(81);
hide = rs.getInt(82);
fb = rs.getInt(83);
proNew = rs.getInt(84);
proMod = rs.getInt(85);
memNew = rs.getInt(86);
memMod = rs.getInt(87);
id = rs.getLong(88);
groups = rs.getInt(89);
atime1 = rs.getInt(90);
atime2 = rs.getInt(91);
atime3 = rs.getInt(92);
atime4 = rs.getInt(93);
atime5 = rs.getInt(94);
afb = rs.getInt(95);
p5 = rs.getString(96);
players = rs.getInt(97);
userg1 = rs.getString(98);
userg2 = rs.getString(99);
userg3 = rs.getString(100);
userg4 = rs.getString(101);
userg5 = rs.getString(102);
userg6 = rs.getString(103);
userg7 = rs.getString(104);
userg8 = rs.getString(105);
userg9 = rs.getString(106);
userg10 = rs.getString(107);
userg11 = rs.getString(108);
userg12 = rs.getString(109);
userg13 = rs.getString(110);
userg14 = rs.getString(111);
userg15 = rs.getString(112);
userg16 = rs.getString(113);
userg17 = rs.getString(114);
userg18 = rs.getString(115);
userg19 = rs.getString(116);
userg20 = rs.getString(117);
userg21 = rs.getString(118);
userg22 = rs.getString(119);
userg23 = rs.getString(120);
userg24 = rs.getString(121);
userg25 = rs.getString(122);
orig_by = rs.getString(123);
p91 = rs.getInt(124);
p92 = rs.getInt(125);
p93 = rs.getInt(126);
p94 = rs.getInt(127);
p95 = rs.getInt(128);
p96 = rs.getInt(129);
p97 = rs.getInt(130);
p98 = rs.getInt(131);
p99 = rs.getInt(132);
p910 = rs.getInt(133);
p911 = rs.getInt(134);
p912 = rs.getInt(135);
p913 = rs.getInt(136);
p914 = rs.getInt(137);
p915 = rs.getInt(138);
p916 = rs.getInt(139);
p917 = rs.getInt(140);
p918 = rs.getInt(141);
p919 = rs.getInt(142);
p920 = rs.getInt(143);
p921 = rs.getInt(144);
p922 = rs.getInt(145);
p923 = rs.getInt(146);
p924 = rs.getInt(147);
p925 = rs.getInt(148);
afb2 = rs.getInt(149);
afb3 = rs.getInt(150);
afb4 = rs.getInt(151);
afb5 = rs.getInt(152);
type = rs.getString(153);
course = rs.getString(154);
date = rs.getInt(155);
if (atime1 != 0) { // only process if its assigned
ok = SystemUtils.checkInUse(con, id); // check if assigned tee times are currently in use
if (ok == true) { // if ok to proceed (no tee times are in use)
//
// Save the usernames
//
userA[0] = user1;
userA[1] = user2;
userA[2] = user3;
userA[3] = user4;
userA[4] = user5;
userA[5] = user6;
userA[6] = user7;
userA[7] = user8;
userA[8] = user9;
userA[9] = user10;
userA[10] = user11;
userA[11] = user12;
userA[12] = user13;
userA[13] = user14;
userA[14] = user15;
userA[15] = user16;
userA[16] = user17;
userA[17] = user18;
userA[18] = user19;
userA[19] = user20;
userA[20] = user21;
userA[21] = user22;
userA[22] = user23;
userA[23] = user24;
userA[24] = user25;
//
// create 1 tee time for each group requested (groups = )
//
time = atime1; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
//
// Save area for tee time and email processing - by groups
//
String g1user1 = user1;
String g1user2 = user2;
String g1user3 = user3;
String g1user4 = user4;
String g1user5 = "";
String g1player1 = player1;
String g1player2 = player2;
String g1player3 = player3;
String g1player4 = player4;
String g1player5 = "";
String g1p1cw = p1cw;
String g1p2cw = p2cw;
String g1p3cw = p3cw;
String g1p4cw = p4cw;
String g1p5cw = "";
String g1userg1 = userg1;
String g1userg2 = userg2;
String g1userg3 = userg3;
String g1userg4 = userg4;
String g1userg5 = "";
int g1p91 = p91;
int g1p92 = p92;
int g1p93 = p93;
int g1p94 = p94;
int g1p95 = 0;
String g2user1 = "";
String g2user2 = "";
String g2user3 = "";
String g2user4 = "";
String g2user5 = "";
String g2player1 = "";
String g2player2 = "";
String g2player3 = "";
String g2player4 = "";
String g2player5 = "";
String g2p1cw = "";
String g2p2cw = "";
String g2p3cw = "";
String g2p4cw = "";
String g2p5cw = "";
String g2userg1 = "";
String g2userg2 = "";
String g2userg3 = "";
String g2userg4 = "";
String g2userg5 = "";
int g2p91 = 0;
int g2p92 = 0;
int g2p93 = 0;
int g2p94 = 0;
int g2p95 = 0;
String g3user1 = "";
String g3user2 = "";
String g3user3 = "";
String g3user4 = "";
String g3user5 = "";
String g3player1 = "";
String g3player2 = "";
String g3player3 = "";
String g3player4 = "";
String g3player5 = "";
String g3p1cw = "";
String g3p2cw = "";
String g3p3cw = "";
String g3p4cw = "";
String g3p5cw = "";
String g3userg1 = "";
String g3userg2 = "";
String g3userg3 = "";
String g3userg4 = "";
String g3userg5 = "";
int g3p91 = 0;
int g3p92 = 0;
int g3p93 = 0;
int g3p94 = 0;
int g3p95 = 0;
String g4user1 = "";
String g4user2 = "";
String g4user3 = "";
String g4user4 = "";
String g4user5 = "";
String g4player1 = "";
String g4player2 = "";
String g4player3 = "";
String g4player4 = "";
String g4player5 = "";
String g4p1cw = "";
String g4p2cw = "";
String g4p3cw = "";
String g4p4cw = "";
String g4p5cw = "";
String g4userg1 = "";
String g4userg2 = "";
String g4userg3 = "";
String g4userg4 = "";
String g4userg5 = "";
int g4p91 = 0;
int g4p92 = 0;
int g4p93 = 0;
int g4p94 = 0;
int g4p95 = 0;
String g5user1 = "";
String g5user2 = "";
String g5user3 = "";
String g5user4 = "";
String g5user5 = "";
String g5player1 = "";
String g5player2 = "";
String g5player3 = "";
String g5player4 = "";
String g5player5 = "";
String g5p1cw = "";
String g5p2cw = "";
String g5p3cw = "";
String g5p4cw = "";
String g5p5cw = "";
String g5userg1 = "";
String g5userg2 = "";
String g5userg3 = "";
String g5userg4 = "";
String g5userg5 = "";
int g5p91 = 0;
int g5p92 = 0;
int g5p93 = 0;
int g5p94 = 0;
int g5p95 = 0;
errorMsg = "Error in SystemUtils moveReqs (get mem# and hndcp): ";
//
// Get Member# and Handicap for each member
//
if (!user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
g1player5 = player5;
g1user5 = user5;
g1p5cw = p5cw;
g1userg5 = userg5;
g1p95 = p95;
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 1 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g1player1);
pstmt6.setString(2, g1player2);
pstmt6.setString(3, g1player3);
pstmt6.setString(4, g1player4);
pstmt6.setString(5, g1user1);
pstmt6.setString(6, g1user2);
pstmt6.setString(7, g1user3);
pstmt6.setString(8, g1user4);
pstmt6.setString(9, g1p1cw);
pstmt6.setString(10, g1p2cw);
pstmt6.setString(11, g1p3cw);
pstmt6.setString(12, g1p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g1player5);
pstmt6.setString(18, g1user5);
pstmt6.setString(19, g1p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g1userg1);
pstmt6.setString(33, g1userg2);
pstmt6.setString(34, g1userg3);
pstmt6.setString(35, g1userg4);
pstmt6.setString(36, g1userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g1p91);
pstmt6.setInt(39, g1p92);
pstmt6.setInt(40, g1p93);
pstmt6.setInt(41, g1p94);
pstmt6.setInt(42, g1p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
//
// Do next group, if there is one
//
if (groups > 1 && count != 0) {
time = atime2; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g2player1 = player6;
g2player2 = player7;
g2player3 = player8;
g2player4 = player9;
g2player5 = player10;
g2user1 = user6;
g2user2 = user7;
g2user3 = user8;
g2user4 = user9;
g2user5 = user10;
g2p1cw = p6cw;
g2p2cw = p7cw;
g2p3cw = p8cw;
g2p4cw = p9cw;
g2p5cw = p10cw;
g2userg1 = userg6;
g2userg2 = userg7;
g2userg3 = userg8;
g2userg4 = userg9;
g2userg5 = userg10;
g2p91 = p96;
g2p92 = p97;
g2p93 = p98;
g2p94 = p99;
g2p95 = p910;
} else {
g2player1 = player5;
g2player2 = player6;
g2player3 = player7;
g2player4 = player8;
g2user1 = user5;
g2user2 = user6;
g2user3 = user7;
g2user4 = user8;
g2p1cw = p5cw;
g2p2cw = p6cw;
g2p3cw = p7cw;
g2p4cw = p8cw;
g2userg1 = userg5;
g2userg2 = userg6;
g2userg3 = userg7;
g2userg4 = userg8;
g2p91 = p95;
g2p92 = p96;
g2p93 = p97;
g2p94 = p98;
}
if (!g2user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 2 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g2player1);
pstmt6.setString(2, g2player2);
pstmt6.setString(3, g2player3);
pstmt6.setString(4, g2player4);
pstmt6.setString(5, g2user1);
pstmt6.setString(6, g2user2);
pstmt6.setString(7, g2user3);
pstmt6.setString(8, g2user4);
pstmt6.setString(9, g2p1cw);
pstmt6.setString(10, g2p2cw);
pstmt6.setString(11, g2p3cw);
pstmt6.setString(12, g2p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g2player5);
pstmt6.setString(18, g2user5);
pstmt6.setString(19, g2p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g2userg1);
pstmt6.setString(33, g2userg2);
pstmt6.setString(34, g2userg3);
pstmt6.setString(35, g2userg4);
pstmt6.setString(36, g2userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g2p91);
pstmt6.setInt(39, g2p92);
pstmt6.setInt(40, g2p93);
pstmt6.setInt(41, g2p94);
pstmt6.setInt(42, g2p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb2);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 2 && count != 0) {
time = atime3; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g3player1 = player11;
g3player2 = player12;
g3player3 = player13;
g3player4 = player14;
g3player5 = player15;
g3user1 = user11;
g3user2 = user12;
g3user3 = user13;
g3user4 = user14;
g3user5 = user15;
g3p1cw = p11cw;
g3p2cw = p12cw;
g3p3cw = p13cw;
g3p4cw = p14cw;
g3p5cw = p15cw;
g3userg1 = userg11;
g3userg2 = userg12;
g3userg3 = userg13;
g3userg4 = userg14;
g3userg5 = userg15;
g3p91 = p911;
g3p92 = p912;
g3p93 = p913;
g3p94 = p914;
g3p95 = p915;
} else {
g3player1 = player9;
g3player2 = player10;
g3player3 = player11;
g3player4 = player12;
g3user1 = user9;
g3user2 = user10;
g3user3 = user11;
g3user4 = user12;
g3p1cw = p9cw;
g3p2cw = p10cw;
g3p3cw = p11cw;
g3p4cw = p12cw;
g3userg1 = userg9;
g3userg2 = userg10;
g3userg3 = userg11;
g3userg4 = userg12;
g3p91 = p99;
g3p92 = p910;
g3p93 = p911;
g3p94 = p912;
}
if (!g3user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g3user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 3 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g3player1);
pstmt6.setString(2, g3player2);
pstmt6.setString(3, g3player3);
pstmt6.setString(4, g3player4);
pstmt6.setString(5, g3user1);
pstmt6.setString(6, g3user2);
pstmt6.setString(7, g3user3);
pstmt6.setString(8, g3user4);
pstmt6.setString(9, g3p1cw);
pstmt6.setString(10, g3p2cw);
pstmt6.setString(11, g3p3cw);
pstmt6.setString(12, g3p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g3player5);
pstmt6.setString(18, g3user5);
pstmt6.setString(19, g3p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g3userg1);
pstmt6.setString(33, g3userg2);
pstmt6.setString(34, g3userg3);
pstmt6.setString(35, g3userg4);
pstmt6.setString(36, g3userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g3p91);
pstmt6.setInt(39, g3p92);
pstmt6.setInt(40, g3p93);
pstmt6.setInt(41, g3p94);
pstmt6.setInt(42, g3p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb3);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 3 && count != 0) {
time = atime4; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g4player1 = player16;
g4player2 = player17;
g4player3 = player18;
g4player4 = player19;
g4player5 = player20;
g4user1 = user16;
g4user2 = user17;
g4user3 = user18;
g4user4 = user19;
g4user5 = user20;
g4p1cw = p16cw;
g4p2cw = p17cw;
g4p3cw = p18cw;
g4p4cw = p19cw;
g4p5cw = p20cw;
g4userg1 = userg16;
g4userg2 = userg17;
g4userg3 = userg18;
g4userg4 = userg19;
g4userg5 = userg20;
g4p91 = p916;
g4p92 = p917;
g4p93 = p918;
g4p94 = p919;
g4p95 = p920;
} else {
g4player1 = player13;
g4player2 = player14;
g4player3 = player15;
g4player4 = player16;
g4user1 = user13;
g4user2 = user14;
g4user3 = user15;
g4user4 = user16;
g4p1cw = p13cw;
g4p2cw = p14cw;
g4p3cw = p15cw;
g4p4cw = p16cw;
g4userg1 = userg13;
g4userg2 = userg14;
g4userg3 = userg15;
g4userg4 = userg16;
g4p91 = p913;
g4p92 = p914;
g4p93 = p915;
g4p94 = p916;
}
if (!g4user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g4user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 4 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g4player1);
pstmt6.setString(2, g4player2);
pstmt6.setString(3, g4player3);
pstmt6.setString(4, g4player4);
pstmt6.setString(5, g4user1);
pstmt6.setString(6, g4user2);
pstmt6.setString(7, g4user3);
pstmt6.setString(8, g4user4);
pstmt6.setString(9, g4p1cw);
pstmt6.setString(10, g4p2cw);
pstmt6.setString(11, g4p3cw);
pstmt6.setString(12, g4p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g4player5);
pstmt6.setString(18, g4user5);
pstmt6.setString(19, g4p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g4userg1);
pstmt6.setString(33, g4userg2);
pstmt6.setString(34, g4userg3);
pstmt6.setString(35, g4userg4);
pstmt6.setString(36, g4userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g4p91);
pstmt6.setInt(39, g4p92);
pstmt6.setInt(40, g4p93);
pstmt6.setInt(41, g4p94);
pstmt6.setInt(42, g4p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb4);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 4 && count != 0) {
time = atime5; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g5player1 = player21;
g5player2 = player22;
g5player3 = player23;
g5player4 = player24;
g5player5 = player25;
g5user1 = user21;
g5user2 = user22;
g5user3 = user23;
g5user4 = user24;
g5user5 = user25;
g5p1cw = p21cw;
g5p2cw = p22cw;
g5p3cw = p23cw;
g5p4cw = p24cw;
g5p5cw = p25cw;
g5userg1 = userg21;
g5userg2 = userg22;
g5userg3 = userg23;
g5userg4 = userg24;
g5userg5 = userg25;
g5p91 = p921;
g5p92 = p922;
g5p93 = p923;
g5p94 = p924;
g5p95 = p925;
} else {
g5player1 = player17;
g5player2 = player18;
g5player3 = player19;
g5player4 = player20;
g5user1 = user17;
g5user2 = user18;
g5user3 = user19;
g5user4 = user20;
g5p1cw = p17cw;
g5p2cw = p18cw;
g5p3cw = p19cw;
g5p4cw = p20cw;
g5userg1 = userg17;
g5userg2 = userg18;
g5userg3 = userg19;
g5userg4 = userg20;
g5p91 = p917;
g5p92 = p918;
g5p93 = p919;
g5p94 = p920;
}
if (!g5user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g5user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 5 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g5player1);
pstmt6.setString(2, g5player2);
pstmt6.setString(3, g5player3);
pstmt6.setString(4, g5player4);
pstmt6.setString(5, g5user1);
pstmt6.setString(6, g5user2);
pstmt6.setString(7, g5user3);
pstmt6.setString(8, g5user4);
pstmt6.setString(9, g5p1cw);
pstmt6.setString(10, g5p2cw);
pstmt6.setString(11, g5p3cw);
pstmt6.setString(12, g5p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g5player5);
pstmt6.setString(18, g5user5);
pstmt6.setString(19, g5p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g5userg1);
pstmt6.setString(33, g5userg2);
pstmt6.setString(34, g5userg3);
pstmt6.setString(35, g5userg4);
pstmt6.setString(36, g5userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g5p91);
pstmt6.setInt(39, g5p92);
pstmt6.setInt(40, g5p93);
pstmt6.setInt(41, g5p94);
pstmt6.setInt(42, g5p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb5);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
/*
//*****************************************************************************
// Send an email to all in this request
//*****************************************************************************
//
errorMsg = "Error in SystemUtils moveReqs (send email): ";
String clubName = "";
try {
estmt = con.createStatement(); // create a statement
rs2 = estmt.executeQuery("SELECT clubName " +
"FROM club5 WHERE clubName != ''");
if (rs2.next()) {
clubName = rs2.getString(1);
}
estmt.close();
}
catch (Exception ignore) {
}
//
// Get today's date and time for email processing
//
Calendar ecal = new GregorianCalendar(); // get todays date
int eyear = ecal.get(Calendar.YEAR);
int emonth = ecal.get(Calendar.MONTH);
int eday = ecal.get(Calendar.DAY_OF_MONTH);
int e_hourDay = ecal.get(Calendar.HOUR_OF_DAY);
int e_min = ecal.get(Calendar.MINUTE);
int e_time = 0;
long e_date = 0;
//
// Build the 'time' string for display
//
// Adjust the time based on the club's time zone (we are Central)
//
e_time = (e_hourDay * 100) + e_min;
e_time = SystemUtils.adjustTime(con, e_time); // adjust for time zone
if (e_time < 0) { // if negative, then we went back or ahead one day
e_time = 0 - e_time; // convert back to positive value
if (e_time < 100) { // if hour is zero, then we rolled ahead 1 day
//
// roll cal ahead 1 day (its now just after midnight, the next day Eastern Time)
//
ecal.add(Calendar.DATE,1); // get next day's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
} else { // we rolled back 1 day
//
// roll cal back 1 day (its now just before midnight, yesterday Pacific or Mountain Time)
//
ecal.add(Calendar.DATE,-1); // get yesterday's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
}
}
int e_hour = e_time / 100; // get adjusted hour
e_min = e_time - (e_hour * 100); // get minute value
int e_am_pm = 0; // preset to AM
if (e_hour > 11) {
e_am_pm = 1; // PM
e_hour = e_hour - 12; // set to 12 hr clock
}
if (e_hour == 0) {
e_hour = 12;
}
String email_time = "";
emonth = emonth + 1; // month starts at zero
e_date = (eyear * 10000) + (emonth * 100) + eday;
//
// get date/time string for email message
//
if (e_am_pm == 0) {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " AM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " AM";
}
} else {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " PM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " PM";
}
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
String to = ""; // to address
String f_b = "";
String eampm = "";
String etime = "";
String enewMsg = "";
int emailOpt = 0; // user's email option parm
int ehr = 0;
int emin = 0;
int send = 0;
PreparedStatement pstmte1 = null;
//
// set the front/back value
//
f_b = "Front";
if (afb == 1) {
f_b = "Back";
}
String enew1 = "";
String enew2 = "";
String subject = "";
if (clubName.startsWith( "Old Oaks" )) {
enew1 = "The following Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Tee Time Assignment Notification";
} else {
if (clubName.startsWith( "Westchester" )) {
enew1 = "The following Draw Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Draw Tee Times have been ASSIGNED.\n\n";
subject = "Your Tee Time for Weekend Draw";
} else {
enew1 = "The following Lottery Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Lottery Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Lottery Assignment Notification";
}
}
if (!clubName.equals( "" )) {
subject = subject + " - " + clubName;
}
Properties properties = new Properties();
properties.put("mail.smtp.host", SystemUtils.host); // set outbound host address
properties.put("mail.smtp.port", SystemUtils.port); // set outbound port
properties.put("mail.smtp.auth", "true"); // set 'use authentication'
Session mailSess = Session.getInstance(properties, SystemUtils.getAuthenticator()); // get session properties
MimeMessage message = new MimeMessage(mailSess);
try {
message.setFrom(new InternetAddress(SystemUtils.EFROM)); // set from addr
message.setSubject( subject ); // set subject line
message.setSentDate(new java.util.Date()); // set date/time sent
}
catch (Exception ignore) {
}
//
// Set the recipient addresses
//
if (!g1user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
//
// send email if anyone to send it to
//
if (send != 0) { // if any email addresses specified for members
//
// Create the message content
//
if (groups > 1) {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
} else {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
}
if (!course.equals( "" )) {
enewMsg = enewMsg + "of Course: " + course;
}
//
// convert time to hour and minutes for email msg
//
time = atime1; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n at " + etime + "\n";
if (!g1player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g1player1 + " " + g1p1cw;
}
if (!g1player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g1player2 + " " + g1p2cw;
}
if (!g1player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g1player3 + " " + g1p3cw;
}
if (!g1player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g1player4 + " " + g1p4cw;
}
if (!g1player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g1player5 + " " + g1p5cw;
}
if (groups > 1) {
time = atime2; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g2player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g2player1 + " " + g2p1cw;
}
if (!g2player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g2player2 + " " + g2p2cw;
}
if (!g2player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g2player3 + " " + g2p3cw;
}
if (!g2player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g2player4 + " " + g2p4cw;
}
if (!g2player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g2player5 + " " + g2p5cw;
}
}
if (groups > 2) {
time = atime3; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g3player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g3player1 + " " + g3p1cw;
}
if (!g3player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g3player2 + " " + g3p2cw;
}
if (!g3player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g3player3 + " " + g3p3cw;
}
if (!g3player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g3player4 + " " + g3p4cw;
}
if (!g3player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g3player5 + " " + g3p5cw;
}
}
if (groups > 3) {
time = atime4; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g4player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g4player1 + " " + g4p1cw;
}
if (!g4player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g4player2 + " " + g4p2cw;
}
if (!g4player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g4player3 + " " + g4p3cw;
}
if (!g4player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g4player4 + " " + g4p4cw;
}
if (!g4player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g4player5 + " " + g4p5cw;
}
}
if (groups > 4) {
time = atime5; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g5player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g5player1 + " " + g5p1cw;
}
if (!g5player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g5player2 + " " + g5p2cw;
}
if (!g5player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g5player3 + " " + g5p3cw;
}
if (!g5player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g5player4 + " " + g5p4cw;
}
if (!g5player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g5player5 + " " + g5p5cw;
}
}
enewMsg = enewMsg + SystemUtils.trailer;
try {
message.setText( enewMsg ); // put msg in email text area
Transport.send(message); // send it!!
}
catch (Exception ignore) {
}
} // end of IF send
*/
if (count == 0) {
// we were not able to update the tee time(s) to contain all requested times in the lottery
out.println(SystemUtils.HeadTitle("Error Converting Lottery Request"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Error Converting Lottery Request");
out.println("<BR>The assigned tee time was not found for this lottery request. You may have to insert the assigned tee time and try again.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + name + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
} else {
//
// delete the request after players have been moved
//
pstmtd = con.prepareStatement (
"DELETE FROM lreqs3 WHERE id = ?");
pstmtd.clearParameters();
pstmtd.setLong(1, id);
pstmtd.executeUpdate();
pstmtd.close();
}
//
// If lottery type = Weighted By Proximity, determine time between request and assigned
//
if (type.equals( "WeightedBP" )) {
proxMins = SystemUtils.calcProxTime(rtime, atime1); // calculate mins difference
pstmtd2 = con.prepareStatement (
"INSERT INTO lassigns5 (username, lname, date, mins) " +
"VALUES (?, ?, ?, ?)");
//
// Save each members' weight for this request
//
for (i=0; i<25; i++) { // check all 25 possible players
if (!userA[i].equals( "" )) { // if player is a member
pstmtd2.clearParameters();
pstmtd2.setString(1, userA[i]);
pstmtd2.setString(2, name);
pstmtd2.setLong(3, date);
pstmtd2.setInt(4, proxMins);
pstmtd2.executeUpdate();
}
}
pstmtd2.close();
} // end of IF Weighted by Proximity lottery type
} // end of IF ok (tee times in use?)
else {
// we were not able to update the tee time(s) to contain all requested times in the lottery
out.println(SystemUtils.HeadTitle("Error Converting Lottery Request"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Tee Time Busy or Occupied</H3>");
out.println("<BR><BR>Error Converting Lottery Request");
out.println("<BR>The assigned tee time for this lottery request is either busy or is already occupied with players.");
out.println("<BR>If the lottery request has multiple groups within, it could be one of the groups assigned times that are busy or occupied.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + name + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
} // end if tee time busy or full
} else { // req is NOT assigned
//
// Change the state to 5 (processed & approved) so _sheet will show the others
//
PreparedStatement pstmt7s = con.prepareStatement (
"UPDATE lreqs3 SET state = 5 " +
"WHERE id = ?");
pstmt7s.clearParameters(); // clear the parms
pstmt7s.setLong(1, id);
pstmt7s.executeUpdate();
pstmt7s.close();
} // end of IF req is assigned
} // end of WHILE lreqs - process next request
pstmt.close();
}
catch (Exception e1) {
//
// save error message in /v_x/error.txt
//
errorMsg = errorMsg + e1.getMessage();
SystemUtils.buildDatabaseErrMsg(e1.toString(), errorMsg, out, false);
return;
}
//
// Completed update - reload page
//
out.println("<meta http-equiv=\"Refresh\" content=\"2; url=/" +rev+ "/servlet/Proshop_dlott?index=" + index + "&course=" + returnCourse + "&lott_name=" + name + "&hide="+hideUnavail+"\">");
out.close();
} // end auto_convert method
//
// Add player to slot
//
private static boolean addPlayer(parmSlot slotParms, String player_name, String username, String cw, int p9hole, boolean allowFives) {
if (slotParms.player1.equals("")) {
slotParms.player1 = player_name;
slotParms.user1 = username;
slotParms.p1cw = cw;
slotParms.p91 = p9hole;
} else if (slotParms.player2.equals("")) {
slotParms.player2 = player_name;
slotParms.user2 = username;
slotParms.p2cw = cw;
slotParms.p92 = p9hole;
} else if (slotParms.player3.equals("")) {
slotParms.player3 = player_name;
slotParms.user3 = username;
slotParms.p3cw = cw;
slotParms.p93 = p9hole;
} else if (slotParms.player4.equals("")) {
slotParms.player4 = player_name;
slotParms.user4 = username;
slotParms.p4cw = cw;
slotParms.p94 = p9hole;
} else if (slotParms.player5.equals("") && allowFives) {
slotParms.player5 = player_name;
slotParms.user5 = username;
slotParms.p5cw = cw;
slotParms.p95 = p9hole;
} else {
return (true);
}
return (false);
}
// *********************************************************
// Process delete request from above
//
// parms: index = index value for date
// course = name of course
// returnCourse = name of course for return to sheet
// jump = jump index for return
// time = time of tee time
// fb = f/b indicator
//
// *********************************************************
private void doDelete(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
ResultSet rs = null;
//
// variables for this class
//
int index = 0;
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int fb = 0;
int hr = 0;
int min = 0;
int time = 0;
String sampm = "AM";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// The 'index' paramter contains an index value
// (0 = today, 1 = tomorrow, etc.)
//
String indexs = req.getParameter("index"); // index value of the day
String course = req.getParameter("course"); // get the course name for this delete request
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String stime = req.getParameter("time"); // get the time of tee time
String sfb = req.getParameter("fb"); // get the fb indicator
String emailOpt = req.getParameter("email"); // get the email indicator
String hide = req.getParameter("hide");
String lott_name = req.getParameter("lott_name");
if (course == null) {
course = ""; // change to null string
}
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(indexs);
fb = Integer.parseInt(sfb);
time = Integer.parseInt(stime);
}
catch (NumberFormatException e) {
// ignore error
}
//
// isolate hr and min values
//
hr = time / 100;
min = time - (hr * 100);
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead 'index' days
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
String day_name = day_table[day_num]; // get name for day
long date = year * 10000; // create a date field of yyyymmdd
date = date + (month * 100);
date = date + day; // date = yyyymmdd (for comparisons)
if (req.getParameter("deleteSubmit") == null) { // if this is the first request
//
// Call is from 'edit' processing above to start a delete request
//
//
// Build the HTML page to prompt user for a confirmation
//
out.println(SystemUtils.HeadTitle("Proshop Delete Confirmation"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\"></font><center>");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\" valign=\"top\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // main page
out.println("<tr><td align=\"center\">");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\" color=\"#000000\"><br><br>");
out.println("<table border=\"2\" bgcolor=\"#F5F5DC\" cellpadding=\"8\" align=\"center\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"time\" value=\"" + time + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"fb\" value=\"" + fb + "\">");
out.println("<input type=\"hidden\" name=\"delete\" value=\"yes\">");
out.println("<tr><td width=\"450\">");
out.println("<font size=\"3\">");
out.println("<p align=\"center\"><b>Delete Confirmation</b></p></font>");
out.println("<br><font size=\"2\">");
out.println("<font size=\"2\">");
out.println("<p align=\"left\">");
//
// Check to see if any players are in this tee time
//
try {
PreparedStatement pstmt1d = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1d.clearParameters(); // clear the parms
pstmt1d.setLong(1, date);
pstmt1d.setInt(2, time);
pstmt1d.setInt(3, fb);
pstmt1d.setString(4, course);
rs = pstmt1d.executeQuery(); // execute the prepared stmt
if (rs.next()) {
player1 = rs.getString(1);
player2 = rs.getString(2);
player3 = rs.getString(3);
player4 = rs.getString(4);
player5 = rs.getString(5);
}
pstmt1d.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
if (!player1.equals( "" ) || !player2.equals( "" ) || !player3.equals( "" ) || !player4.equals( "" ) || !player5.equals( "" )) {
out.println("<b>Warning:</b> You are about to permanently remove a tee time ");
out.println("which contains the following player(s):<br>");
if (!player1.equals( "" )) {
out.println("<br>" +player1);
}
if (!player2.equals( "" )) {
out.println("<br>" +player2);
}
if (!player3.equals( "" )) {
out.println("<br>" +player3);
}
if (!player4.equals( "" )) {
out.println("<br>" +player4);
}
if (!player5.equals( "" )) {
out.println("<br>" +player5);
}
out.println("<br><br>This will remove the entire tee time slot from the database. ");
out.println(" If you wish to only remove the players, then return to the tee sheet and select the tee time to update it.");
out.println("</p>");
} else {
out.println("<b>Warning:</b> You are about to permanently remove the following tee time.<br><br>");
out.println("This will remove the entire tee time slot from the database. ");
out.println(" If you wish to only remove the players, then return to the tee sheet and select the tee time to update it.");
out.println("</p>");
}
//
// build the time string
//
sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
out.println("<p align=\"center\">");
if (min < 10) {
out.println("Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>Are you sure you want to delete this tee time?</p>");
out.println("<p align=\"center\">");
out.println("<input type=\"submit\" value=\"Yes - Delete It\" name=\"deleteSubmit\"></p>");
out.println("</font></td></tr></form></table>");
out.println("<br><br>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"submit\" value=\"No - Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"No - Return to Tee Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
//
// End of HTML page
//
out.println("</td></tr></table>"); // end of main page
out.println("</td></tr></table>"); // end of whole page
out.println("</center></body></html>");
out.close();
} else {
//
// Call is from self to process a delete request (final - this is the confirmation)
//
// Check to make sure a slot like this already exists
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"SELECT mm FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setLong(1, date);
pstmt1.setInt(2, time);
pstmt1.setInt(3, fb);
pstmt1.setString(4, course);
rs = pstmt1.executeQuery(); // execute the prepared stmt
if (!rs.next()) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Data Entry Error</H3>");
out.println("<BR><BR>A tee time with these date, time and F/B values does not exist.");
out.println("<BR><BR>Please try again.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
out.close();
return;
} // ok if we get here - matching time slot found
pstmt1.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
//
// This slot was found - delete it from the database
//
try {
PreparedStatement pstmt2 = con.prepareStatement (
"DELETE FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt2.clearParameters(); // clear the parms
pstmt2.setLong(1, date);
pstmt2.setInt(2, time);
pstmt2.setInt(3, fb);
pstmt2.setString(4, course);
int count = pstmt2.executeUpdate(); // execute the prepared stmt
pstmt2.close(); // close the stmt
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>" + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// Delete complete - inform user
//
sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
out.println("<HTML><HEAD><title>Proshop Delete Confirmation</title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +indexs+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&jump=" +jump+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center>");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("><BR><BR><H3>Delete Tee Time Confirmation</H3>");
out.println("<BR><BR>Thank you, the following tee time has been removed.");
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
if (min < 10) {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</center></BODY></HTML>");
out.close();
}
} // end of doDelete
// *********************************************************
// Process a delete request for a lottery
//
// Parms: lotteryId = uid for request to be deleted
//
// *********************************************************
private void doDeleteLottery(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
String sindex = req.getParameter("index"); // index value of the day
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String emailOpt = req.getParameter("email"); // get the email indicator
String lott_name = req.getParameter("lott_name");
String hide = req.getParameter("hide");
String slid = req.getParameter("lotteryId");
int index = 0;
int lottery_id = 0;
if (slid == null) slid = "";
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(sindex);
lottery_id = Integer.parseInt(slid);
}
catch (NumberFormatException e) { }
try {
PreparedStatement pstmt2 = con.prepareStatement (
"DELETE FROM lreqs3 WHERE id = ?");
pstmt2.clearParameters();
pstmt2.setInt(1, lottery_id);
pstmt2.executeUpdate();
pstmt2.close();
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>" + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
out.println("<HTML><HEAD><title>Proshop Delete Confirmation</title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&jump=" +jump+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center>");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<BR><BR><H3>Delete Lottery Request Confirmation</H3>");
out.println("<BR><BR>Thank you, the request has been removed.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + index + ">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
}
// *********************************************************
// Process insert request from above
//
// parms: index = index value for date
// course = name of course
// returnCourse = name of course for return to sheet
// jump = jump index for return
// time = time of tee time
// fb = f/b indicator
// insertSubmit = if from self
// first = if first tee time
//
// *********************************************************
private void doInsert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
ResultSet rs = null;
//
// variables for this method
//
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int hr = 0;
int min = 0;
int ampm = 0;
int fb = 0;
int time = 0;
int otime = 0;
int index = 0;
int event_type = 0;
int notify_id = 0;
String event = "";
String event_color = "";
String rest = "";
String rest2 = "";
String rest_color = "";
String rest_color2 = "";
String rest_recurr = "";
String rest5 = ""; // default values
String rest52 = "";
String rest5_color = "";
String rest5_color2 = "";
String rest5_recurr = "";
String lott = ""; // lottery name
String lott2 = ""; // lottery name
String lott_color = "";
String lott_color2 = "";
String lott_recurr = "";
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// The 'index' paramter contains an index value
// (0 = today, 1 = tomorrow, etc.)
//
String indexs = req.getParameter("index"); // index value of the day
String course = req.getParameter("course"); // get the course name for this insert
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String sfb = req.getParameter("fb");
String times = req.getParameter("time"); // get the tee time selected (hhmm)
String first = req.getParameter("first"); // get the first tee time indicator (yes or no)
String emailOpt = req.getParameter("email"); // get the email option from _sheet
String snid = req.getParameter("notifyId");
String hide = req.getParameter("hide");
String lott_name = req.getParameter("lott_name");
if (course == null) course = "";
if (snid == null) snid = "";
if (times == null) times = "";
if (sfb == null) sfb = "";
//
// Convert the index value from string to int
//
try {
time = Integer.parseInt(times);
index = Integer.parseInt(indexs);
fb = Integer.parseInt(sfb);
notify_id = Integer.parseInt(snid);
}
catch (NumberFormatException e) { }
//
// isolate hr and min values
//
hr = time / 100;
min = time - (hr * 100);
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead (or back) 'index' days
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH) + 1;
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
String day_name = day_table[day_num]; // get name for day
long date = year * 10000; // create a date field of yyyymmdd
date = date + (month * 100) + day; // date = yyyymmdd (for comparisons)
if (req.getParameter("insertSubmit") == null) { // if not an insert 'submit' request (from self)
//
// Process the initial call to Insert a New Tee Time
//
// Build the HTML page to prompt user for a specific time slot
//
out.println(SystemUtils.HeadTitle("Proshop Insert Tee Time Page"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\"></font><center>");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\" valign=\"top\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // main page
out.println("<tr><td align=\"center\">");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\" color=\"#000000\">");
out.println("<font size=\"5\">");
out.println("<p align=\"center\"><b>Insert Tee Sheet</b></p></font>");
out.println("<font size=\"2\">");
out.println("<table cellpadding=\"5\" align=\"center\" width=\"450\">");
out.println("<tr><td colspan=\"4\" bgcolor=\"#336633\"><font color=\"#FFFFFF\" size=\"2\">");
out.println("<b>Instructions:</b> To insert a tee time for the date shown below, select the time");
out.println(" and the 'front/back' values. Select 'Insert' to add the new tee time.");
out.println("</font></td></tr></table><br>");
out.println("<table border=\"2\" bgcolor=\"#F5F5DC\" cellpadding=\"8\" align=\"center\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"insert\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<tr><td width=\"450\">");
out.println("<font size=\"2\">");
out.println("<p align=\"left\">");
out.println("<b>Note:</b> This tee time must be unique from all others on the sheet. ");
out.println("Therefore, at least one of these values must be different than other tee times.");
out.println("<p align=\"center\">Date: <b>" + day_name + " " + month + "/" + day + "/" + year + "</b></p>");
out.println("Time: ");
out.println("<select size=\"1\" name=\"time\">");
//
// Define some variables for this processing
//
PreparedStatement pstmt1b = null;
String dampm = " AM";
int dhr = hr;
int i = 0;
int i2 = 0;
int mint = min;
int hrt = hr;
int last = 0;
int start = 0;
int maxtimes = 20;
//
// Determine time values to be used for selection
//
loopt:
while (i < maxtimes) {
mint++; // next minute
if (mint > 59) {
mint = 0; // rotate the hour
hrt++;
}
if (hrt > 23) {
hrt = 23;
mint = 59;
break loopt; // done
}
if (i == 0) { // if first time
start = (hrt * 100) + mint; // save first time for select
}
i++;
}
last = (hrt * 100) + mint; // last time for select
try {
//
// Find the next time - after the time selected - use as the limit for selection list
//
pstmt1b = con.prepareStatement (
"SELECT time FROM teecurr2 " +
"WHERE date = ? AND time > ? AND time < ? AND fb = ? AND courseName = ? " +
"ORDER BY time");
pstmt1b.clearParameters(); // clear the parms
pstmt1b.setLong(1, date);
pstmt1b.setInt(2, time);
pstmt1b.setInt(3, last);
pstmt1b.setInt(4, fb);
pstmt1b.setString(5, course);
rs = pstmt1b.executeQuery(); // execute the prepared stmt
if (rs.next()) {
last = rs.getInt(1); // get the first time found - use as upper limit for display
}
pstmt1b.close();
}
catch (Exception e) {
}
i = 0;
//
// If first tee time on sheet, then allow 20 tee times prior to this time.
//
if (first.equalsIgnoreCase( "yes" )) {
mint = min; // get original time
hrt = hr;
while (i < maxtimes) { // determine the first time
if (mint > 0) {
mint--;
} else { // assume not midnight
hrt--;
mint = 59;
}
i++;
}
start = (hrt * 100) + mint; // save first time for select
maxtimes = 40; // new max for this request
}
//
// Start with the time selected in case they want a tee time with same time, different f/b
//
if (dhr > 11) {
dampm = " PM";
}
if (dhr > 12) {
dhr = dhr - 12;
}
if (min < 10) {
out.println("<option value=\"" +time+ "\">" +dhr+ ":0" +min+ " " +dampm+ "</option>");
} else {
out.println("<option value=\"" +time+ "\">" +dhr+ ":" +min+ " " +dampm+ "</option>");
}
//
// list tee times that follow the one selected, but less than 'last'
//
otime = time; // save original time value
i = 0;
hr = start / 100; // get values for start time (first in select list)
min = start - (hr * 100);
loop1:
while (i < maxtimes) {
dhr = hr; // init as same
dampm = " AM";
if (hr == 0) {
dhr = 12;
}
if (hr > 12) {
dampm = " PM";
dhr = hr - 12;
}
if (hr == 12) {
dampm = " PM";
}
time = (hr * 100) + min; // set time value
if (time >= last) { // if we reached the end
break loop1; // done
}
if (time != otime) { // if not same as original time
if (min < 10) {
out.println("<option value=\"" +time+ "\">" +dhr+ ":0" +min+ " " +dampm+ "</option>");
} else {
out.println("<option value=\"" +time+ "\">" +dhr+ ":" +min+ " " +dampm+ "</option>");
}
}
min++; // next minute
if (min > 59) {
min = 0; // rotate the hour
hr++;
}
if (hr > 23) {
break loop1; // done
}
i++;
} // end of while
out.println("</select>");
out.println(" ");
out.println("Front/Back: ");
out.println("<select size=\"1\" name=\"fb\">");
out.println("<option value=\"00\">Front</option>");
out.println("<option value=\"01\">Back</option>");
out.println("<option value=\"09\">Crossover</option>");
out.println("</select>");
out.println("<br><br></p>");
out.println("<p align=\"center\">");
out.println("<input type=\"submit\" value=\"Insert\" name=\"insertSubmit\"></p>");
out.println("</font></td></tr></form></table>");
out.println("<br><br>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" +hide+ "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" +lott_name+ "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
//
// End of HTML page
//
out.println("</td></tr></table>"); // end of main page
out.println("</td></tr></table>"); // end of whole page
out.println("</center></body></html>");
out.close();
} else { // end of Insert Submit processing
//
// Call is from self to process an insert request (submit)
//
// Parms passed: time = time of the tee time to be inserted
// date = date of the tee sheet
// fb = the front/back value (see above)
// course = course name
// returnCourse = course name for return
//
// Check to make sure a slot like this doesn't already exist
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"SELECT mm FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setLong(1, date);
pstmt1.setInt(2, time);
pstmt1.setInt(3, fb);
pstmt1.setString(4, course);
rs = pstmt1.executeQuery(); // execute the prepared stmt
if (rs.next()) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Data Entry Error</H3>");
out.println("<BR><BR>A tee time with these date, time and F/B values already exists.");
out.println("<BR>One of these values must change so the tee time is unique.");
out.println("<BR><BR>Please try again.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
return;
} // ok if we get here - not matching time slot
pstmt1.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
//
// This slot is unique - now check for events or restrictions for this date and time
//
try {
SystemUtils.insertTee(date, time, fb, course, day_name, con); // insert new tee time
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>Error in Proshop_dlott: " + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// Insert complete - inform user
//
String sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
out.println("<HTML><HEAD><Title>Proshop Insert Confirmation</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +indexs+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Insert Tee Time Confirmation</H3>");
out.println("<BR><BR>Thank you, the following tee time has been added.");
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
if (min < 10) {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Continue\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</center></BODY></HTML>");
//
// Refresh the blockers in case the tee time added is covered by a blocker
//
SystemUtils.doBlockers(con);
out.close();
}
} // end of doInsert
// *********************************************************
// changeCW - change the C/W option for 1 or all players in tee time.
//
// parms:
// jump = jump index for return
// from_player = player position being changed (1-5)
// from_time = tee time being changed
// from_fb = f/b of tee time
// from_course = name of course
// to_from = current C/W option
// to_to = new C/W option
// changeAll = change all players in slot (true or false)
// ninehole = use 9 Hole options (true or false)
//
// *********************************************************
private void changeCW(parmSlot slotParms, String changeAll, String ninehole, long date, HttpServletRequest req, PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String newcw = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.changeCW - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use
//
try {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
catch (Exception e1) {
String eMsg = "Error 1 in changeCW. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req);
return;
}
//
// Ok - get current player info from the parm block (set by checkInUse)
//
player1 = slotParms.player1;
player2 = slotParms.player2;
player3 = slotParms.player3;
player4 = slotParms.player4;
player5 = slotParms.player5;
p1cw = slotParms.p1cw;
p2cw = slotParms.p2cw;
p3cw = slotParms.p3cw;
p4cw = slotParms.p4cw;
p5cw = slotParms.p5cw;
p91 = slotParms.p91;
p92 = slotParms.p92;
p93 = slotParms.p93;
p94 = slotParms.p94;
p95 = slotParms.p95;
//
// If '9 Hole' option selected, then change new C/W to 9 hole type
//
newcw = slotParms.to_to; // get selected C/W option
//
// Set the new C/W value for each player requested
//
if (!player1.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 1)) { // change this one?
p1cw = newcw;
if (ninehole.equals( "true" )) {
p91 = 1; // make it a 9 hole type
} else {
p91 = 0; // make it 18 hole
}
}
}
if (!player2.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 2)) { // change this one?
p2cw = newcw;
if (ninehole.equals( "true" )) {
p92 = 1; // make it a 9 hole type
} else {
p92 = 0; // make it 18 hole
}
}
}
if (!player3.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 3)) { // change this one?
p3cw = newcw;
if (ninehole.equals( "true" )) {
p93 = 1; // make it a 9 hole type
} else {
p93 = 0; // make it 18 hole
}
}
}
if (!player4.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 4)) { // change this one?
p4cw = newcw;
if (ninehole.equals( "true" )) {
p94 = 1; // make it a 9 hole type
} else {
p94 = 0; // make it 18 hole
}
}
}
if (!player5.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 5)) { // change this one?
p5cw = newcw;
if (ninehole.equals( "true" )) {
p95 = 1; // make it a 9 hole type
} else {
p95 = 0; // make it 18 hole
}
}
}
//
// Update the tee time and set it no longer in use
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET " +
"p1cw=?, p2cw=?, p3cw=?, p4cw=?, in_use=0, p5cw=?, p91=?, p92=?, p93=?, p94=?, p95=? " +
"WHERE date=? AND time=? AND fb=? AND courseName=?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setString(1, p1cw);
pstmt1.setString(2, p2cw);
pstmt1.setString(3, p3cw);
pstmt1.setString(4, p4cw);
pstmt1.setString(5, p5cw);
pstmt1.setInt(6, p91);
pstmt1.setInt(7, p92);
pstmt1.setInt(8, p93);
pstmt1.setInt(9, p94);
pstmt1.setInt(10, p95);
pstmt1.setLong(11, date);
pstmt1.setInt(12, slotParms.from_time);
pstmt1.setInt(13, slotParms.from_fb);
pstmt1.setString(14, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception e1) {
String eMsg = "Error 2 in changeCW. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
} // end of changeCW
// *********************************************************
// changeFB - change the F/B option for the tee time specified.
//
// parms:
// jump = jump index for return
// from_time = tee time being changed
// from_fb = current f/b of tee time
// from_course = name of course
// to_fb = new f/b of tee time
//
// *********************************************************
private void changeFB(parmSlot slotParms, long date, HttpServletRequest req, PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.changeFB - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use
//
try {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
catch (Exception e1) {
String eMsg = "Error 1 in changeFB. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req);
return;
}
//
// Ok, tee time not busy - change the F/B
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = 0, fb = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, slotParms.to_fb);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception e1) {
String eMsg = "Error 2 in changeFB. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
} // end of changeFB
// *********************************************************
// moveWhole - move an entire tee time
//
// parms:
// jump = jump index for return
// from_time = tee time being moved
// from_fb = f/b of tee time being moved
// from_course = name of course of tee time being moved
// to_time = tee time to move to
// to_fb = f/b of tee time to move to
// to_course = name of course of tee time to move to
//
// prompt = null if first call here
// = 'return' if user wants to return w/o changes
// = 'continue' if user wants to continue with changes
// skip = verification process to skip if 2nd return
//
// *********************************************************
private void moveWhole(parmSlot slotParms, long date, String prompt, int skip, HttpServletRequest req,
PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
String hideUnavail = req.getParameter("hide");
String p1 = "";
String p2 = "";
String p3 = "";
String p4 = "";
String p5 = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String mNum1 = "";
String mNum2 = "";
String mNum3 = "";
String mNum4 = "";
String mNum5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String orig_by = "";
String conf = "";
String notes = "";
short pos1 = 0;
short pos2 = 0;
short pos3 = 0;
short pos4 = 0;
short pos5 = 0;
short show1 = 0;
short show2 = 0;
short show3 = 0;
short show4 = 0;
short show5 = 0;
int hide = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int fives = 0;
int sendemail = 0;
float hndcp1 = 0;
float hndcp2 = 0;
float hndcp3 = 0;
float hndcp4 = 0;
float hndcp5 = 0;
boolean error = false;
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveWhole - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use (the FROM tee time)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, then tee time is already busy
in_use = 0;
getTeeTimeData(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 1 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req); // reject as busy
return;
}
//
// Ok - get current 'FROM' player info from the parm block (set by checkInUse) and save it
//
player1 = slotParms.player1;
player2 = slotParms.player2;
player3 = slotParms.player3;
player4 = slotParms.player4;
player5 = slotParms.player5;
p1cw = slotParms.p1cw;
p2cw = slotParms.p2cw;
p3cw = slotParms.p3cw;
p4cw = slotParms.p4cw;
p5cw = slotParms.p5cw;
user1 = slotParms.user1;
user2 = slotParms.user2;
user3 = slotParms.user3;
user4 = slotParms.user4;
user5 = slotParms.user5;
hndcp1 = slotParms.hndcp1;
hndcp2 = slotParms.hndcp2;
hndcp3 = slotParms.hndcp3;
hndcp4 = slotParms.hndcp4;
hndcp5 = slotParms.hndcp5;
show1 = slotParms.show1;
show2 = slotParms.show2;
show3 = slotParms.show3;
show4 = slotParms.show4;
show5 = slotParms.show5;
pos1 = slotParms.pos1;
pos2 = slotParms.pos2;
pos3 = slotParms.pos3;
pos4 = slotParms.pos4;
pos5 = slotParms.pos5;
mNum1 = slotParms.mNum1;
mNum2 = slotParms.mNum2;
mNum3 = slotParms.mNum3;
mNum4 = slotParms.mNum4;
mNum5 = slotParms.mNum5;
userg1 = slotParms.userg1;
userg2 = slotParms.userg2;
userg3 = slotParms.userg3;
userg4 = slotParms.userg4;
userg5 = slotParms.userg5;
notes = slotParms.notes;
hide = slotParms.hide;
orig_by = slotParms.orig_by;
conf = slotParms.conf;
p91 = slotParms.p91;
p92 = slotParms.p92;
p93 = slotParms.p93;
p94 = slotParms.p94;
p95 = slotParms.p95;
slotParms.player1 = ""; // init parmSlot player fields (verifySlot will fill)
slotParms.player2 = "";
slotParms.player3 = "";
slotParms.player4 = "";
slotParms.player5 = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.to_time == 0 || slotParms.to_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveWhole2 - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.to_time+ ", course= " +slotParms.to_course+ ", fb= " +slotParms.to_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Now check if the 'TO' tee time is currently in use (this will put its info in slotParms)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 2 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
//
// If 'TO' tee time is in use
//
if (in_use != 0) {
//
// Error - We must free up the 'FROM' tee time
//
in_use = 0;
try {
PreparedStatement pstmt4 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt4.clearParameters(); // clear the parms
pstmt4.setInt(1, in_use);
pstmt4.setLong(2, date);
pstmt4.setInt(3, slotParms.from_time);
pstmt4.setInt(4, slotParms.from_fb);
pstmt4.setString(5, slotParms.from_course);
pstmt4.executeUpdate(); // execute the prepared stmt
pstmt4.close();
}
catch (Exception ignore) {
}
teeBusy(out, slotParms, req);
return;
}
//
// If user was prompted and opted to return w/o changes, then we must clear the 'in_use' flags
// before returning to the tee sheet.
//
if (prompt.equals( "return" )) { // if prompt specified a return
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters();
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
// return to Proshop_dlott
out.println("<HTML><HEAD><Title>Proshop Edit Lottery Complete</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&email=" + slotParms.sendEmail + "&jump=" + slotParms.jump + "&lott_name=" +slotParms.lottery+ "&hide=" +hideUnavail+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<BR><BR><H2>Return Accepted</H2>");
out.println("<BR><BR>Thank you, click Return' below if this does not automatically return.<BR>");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} else { // not a 'return' response from prompt
//
// This is either the first time here, or a 'Continue' reply to a prompt
//
//
p1 = slotParms.player1; // get players' names for easier reference
p2 = slotParms.player2;
p3 = slotParms.player3;
p4 = slotParms.player4;
p5 = slotParms.player5;
//
// If any skips are set, then we've already been through here.
//
if (skip == 0) {
//
// Check if 'TO' tee time is empty
//
if (!p1.equals( "" ) || !p2.equals( "" ) || !p3.equals( "" ) || !p4.equals( "" ) || !p5.equals( "" )) {
//
// Tee time is occupied - inform user and ask to continue or cancel
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Tee Time is Occupied</H3><BR>");
out.println("<BR>WARNING: The tee time you are trying to move TO is already occupied.");
out.println("<BR><BR>If you continue, this tee time will effectively be cancelled.");
out.println("<BR><BR>Would you like to continue and overwrite this tee time?");
out.println("<BR><BR>");
out.println("<BR><BR>Course = " +slotParms.to_course+ ", p1= " +p1+ ", p2= " +p2+ ", p3= " +p3+ ", p4= " +p4+ ", p5= " +p5+ ".");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"1\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 2) {
//
// *******************************************************************************
// Check member restrictions in 'TO' tee time, but 'FROM' players
//
// First, find all restrictions within date & time constraints on this course.
// Then, find the ones for this day.
// Then, find any for this member type or membership type (all 5 players).
//
// *******************************************************************************
//
//
// allocate and setup new parm block to hold the tee time parms for this process
//
parmSlot slotParms2 = new parmSlot(); // allocate a parm block
slotParms2.date = date; // get 'TO' info
slotParms2.time = slotParms.to_time;
slotParms2.course = slotParms.to_course;
slotParms2.fb = slotParms.to_fb;
slotParms2.day = slotParms.day;
slotParms2.player1 = player1; // get 'FROM' info
slotParms2.player2 = player2;
slotParms2.player3 = player3;
slotParms2.player4 = player4;
slotParms2.player5 = player5;
try {
verifySlot.parseGuests(slotParms2, con); // check for guests and set guest types
error = verifySlot.parseNames(slotParms2, "pro"); // get the names (lname, fname, mi)
verifySlot.getUsers(slotParms2, con); // get the mship and mtype info (needs lname, fname, mi)
error = false; // init error indicator
error = verifySlot.checkMemRests(slotParms2, con); // check restrictions
}
catch (Exception ignore) {
}
if (error == true) { // if we hit on a restriction
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>" + slotParms2.player + "</b> is restricted from playing during this time.<br><br>");
out.println("This time slot has the following restriction: <b>" + slotParms2.rest_name + "</b><br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"2\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 3) {
//
// *******************************************************************************
// Check 5-some restrictions - use 'FROM' player5 and 'TO' tee time slot
//
// If 5-somes are restricted during this tee time, warn the proshop user.
// *******************************************************************************
//
if ((!player5.equals( "" )) && (!slotParms.rest5.equals( "" ))) { // if 5-somes restricted prompt user to skip test
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are restricted during this time.<br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"3\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 4) {
//
// *******************************************************************************
// Check 5-somes allowed on 'to course' and from-player5 specified
// *******************************************************************************
//
if (!player5.equals( "" )) { // if player5 exists in 'from' slot
fives = 0;
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 WHERE courseName = ?");
pstmtc.clearParameters(); // clear the parms
pstmtc.setString(1, slotParms.to_course);
rs = pstmtc.executeQuery(); // execute the prepared stmt
if (rs.next()) {
fives = rs.getInt("fives");
}
pstmtc.close();
}
catch (Exception e) {
}
if (fives == 0) { // if 5-somes not allowed on to_course
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>5-Somes Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are not allowed on the course player5 is being moved to.");
out.println("<BR>Player5 will be lost if you continue.<br><br>");
out.println("<BR><BR>Would you like to move this tee time without player5?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"4\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
}
} // end of IF 'return' reply from prompt
//
// If we get here, then the move is OK
//
// - move 'FROM' tee time info into this one (TO)
//
if (skip == 4) { // if player5 being moved to course that does not allow 5-somes
player5 = "";
user5 = "";
userg5 = "";
}
in_use = 0;
//
// Make sure we have the players and other info (this has failed before!!!)
//
if (!player1.equals( "" ) || !player2.equals( "" ) || !player3.equals( "" ) || !player4.equals( "" ) || !player5.equals( "" )) {
try {
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = ?, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = ?, show2 = ?, show3 = ?, show4 = ?, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = ?, notes = ?, hideNotes = ?, " +
"mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, conf = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ?, pos1 = ?, pos2 = ?, pos3 = ?, pos4 = ?, pos5 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, player1);
pstmt6.setString(2, player2);
pstmt6.setString(3, player3);
pstmt6.setString(4, player4);
pstmt6.setString(5, user1);
pstmt6.setString(6, user2);
pstmt6.setString(7, user3);
pstmt6.setString(8, user4);
pstmt6.setString(9, p1cw);
pstmt6.setString(10, p2cw);
pstmt6.setString(11, p3cw);
pstmt6.setString(12, p4cw);
pstmt6.setInt(13, in_use); // set in_use to NOT
pstmt6.setFloat(14, hndcp1);
pstmt6.setFloat(15, hndcp2);
pstmt6.setFloat(16, hndcp3);
pstmt6.setFloat(17, hndcp4);
pstmt6.setShort(18, show1);
pstmt6.setShort(19, show2);
pstmt6.setShort(20, show3);
pstmt6.setShort(21, show4);
pstmt6.setString(22, player5);
pstmt6.setString(23, user5);
pstmt6.setString(24, p5cw);
pstmt6.setFloat(25, hndcp5);
pstmt6.setShort(26, show5);
pstmt6.setString(27, notes);
pstmt6.setInt(28, hide);
pstmt6.setString(29, mNum1);
pstmt6.setString(30, mNum2);
pstmt6.setString(31, mNum3);
pstmt6.setString(32, mNum4);
pstmt6.setString(33, mNum5);
pstmt6.setString(34, userg1);
pstmt6.setString(35, userg2);
pstmt6.setString(36, userg3);
pstmt6.setString(37, userg4);
pstmt6.setString(38, userg5);
pstmt6.setString(39, orig_by);
pstmt6.setString(40, conf);
pstmt6.setInt(41, p91);
pstmt6.setInt(42, p92);
pstmt6.setInt(43, p93);
pstmt6.setInt(44, p94);
pstmt6.setInt(45, p95);
pstmt6.setShort(46, pos1);
pstmt6.setShort(47, pos2);
pstmt6.setShort(48, pos3);
pstmt6.setShort(49, pos4);
pstmt6.setShort(50, pos5);
pstmt6.setLong(51, date);
pstmt6.setInt(52, slotParms.to_time);
pstmt6.setInt(53, slotParms.to_fb);
pstmt6.setString(54, slotParms.to_course);
pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
}
catch (Exception e1) {
String eMsg = "Error 3 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Track the history of this tee time - make entry in 'teehist' table (check if new or update)
//
String fullName = "Edit Tsheet Moved From " + slotParms.from_time;
// new tee time
SystemUtils.updateHist(date, slotParms.day, slotParms.to_time, slotParms.to_fb, slotParms.to_course, player1, player2, player3,
player4, player5, slotParms.user, fullName, 0, con);
//
// Finally, set the 'FROM' tee time to NOT in use and clear out the players
//
try {
PreparedStatement pstmt5 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = '', player2 = '', player3 = '', player4 = '', " +
"username1 = '', username2 = '', username3 = '', username4 = '', " +
"in_use = 0, show1 = 0, show2 = 0, show3 = 0, show4 = 0, " +
"player5 = '', username5 = '', show5 = 0, " +
"notes = '', " +
"mNum1 = '', mNum2 = '', mNum3 = '', mNum4 = '', mNum5 = '', " +
"userg1 = '', userg2 = '', userg3 = '', userg4 = '', userg5 = '', orig_by = '', conf = '', " +
"pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0, pos5 = 0 " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt5.clearParameters(); // clear the parms
pstmt5.setLong(1, date);
pstmt5.setInt(2, slotParms.from_time);
pstmt5.setInt(3, slotParms.from_fb);
pstmt5.setString(4, slotParms.from_course);
pstmt5.executeUpdate(); // execute the prepared stmt
pstmt5.close();
if (slotParms.sendEmail.equalsIgnoreCase( "yes" )) { // if ok to send emails
sendemail = 1; // tee time moved - send email notification
}
}
catch (Exception e1) {
String eMsg = "Error 4 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Track the history of this tee time - make entry in 'teehist' table (check if new or update)
//
String empty = "";
fullName = "Edit Tsheet Move To " + slotParms.to_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.from_time, slotParms.from_fb, slotParms.from_course, empty, empty, empty,
empty, empty, slotParms.user, fullName, 1, con);
} else {
//
// save message in error log
//
String msg = "Error in Proshop_dlott.moveWhole - Player names lost " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
teeBusy(out, slotParms, req); // pretend its busy
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
try {
resp.flushBuffer(); // force the repsonse to complete
}
catch (Exception ignore) {
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
if (sendemail != 0) {
//
// allocate a parm block to hold the email parms
//
parmEmail parme = new parmEmail(); // allocate an Email parm block
//
// Set the values in the email parm block
//
parme.type = "moveWhole"; // type = Move Whole tee time
parme.date = date;
parme.time = 0;
parme.to_time = slotParms.to_time;
parme.from_time = slotParms.from_time;
parme.fb = 0;
parme.to_fb = slotParms.to_fb;
parme.from_fb = slotParms.from_fb;
parme.to_course = slotParms.to_course;
parme.from_course = slotParms.from_course;
parme.mm = slotParms.mm;
parme.dd = slotParms.dd;
parme.yy = slotParms.yy;
parme.user = slotParms.user;
parme.emailNew = 0;
parme.emailMod = 0;
parme.emailCan = 0;
parme.p91 = p91;
parme.p92 = p92;
parme.p93 = p93;
parme.p94 = p94;
parme.p95 = p95;
parme.day = slotParms.day;
parme.player1 = player1;
parme.player2 = player2;
parme.player3 = player3;
parme.player4 = player4;
parme.player5 = player5;
parme.user1 = user1;
parme.user2 = user2;
parme.user3 = user3;
parme.user4 = user4;
parme.user5 = user5;
parme.pcw1 = p1cw;
parme.pcw2 = p2cw;
parme.pcw3 = p3cw;
parme.pcw4 = p4cw;
parme.pcw5 = p5cw;
//
// Send the email
//
sendEmail.sendIt(parme, con); // in common
} // end of IF sendemail
} // end of moveWhole
// *********************************************************
// moveSingle - move a single player
//
// parms:
// jump = jump index for return
// from_player = player position being moved (1-5)
// from_time = tee time being moved
// from_fb = f/b of tee time being moved
// from_course = name of course
// to_player = player position to move to (1-5)
// to_time = tee time to move to
// to_fb = f/b of tee time to move to
// to_course = name of course
//
// prompt = null if first call here
// = 'return' if user wants to return w/o changes
// = 'continue' if user wants to continue with changes
// skip = verification process to skip if 2nd return
//
// *********************************************************
private void moveSingle(parmSlot slotParms, long date, String prompt, int skip, HttpServletRequest req,
PrintWriter out, Connection con, HttpServletResponse resp) {
PreparedStatement pstmt6 = null;
ResultSet rs = null;
int fives = 0;
int in_use = 0;
int from = slotParms.from_player; // get the player positions (1-5)
int fr = from; // save original value
int to = slotParms.to_player;
int sendemail = 0;
//
// arrays to hold the player info (FROM tee time)
//
String [] p = new String [5];
String [] player = new String [5];
String [] pcw = new String [5];
String [] user = new String [5];
String [] mNum = new String [5];
String [] userg = new String [5];
short [] show = new short [5];
short [] pos = new short [5];
float [] hndcp = new float [5];
int [] p9 = new int [5];
boolean error = false;
String fullName = "Proshop Edit Lottery"; // for tee time history
String hide = req.getParameter("hide");
//
// adjust the player positions so they can be used for array indexes
//
if (to > 0 && to < 6) {
to--;
} else {
to = 1; // prevent big problem
}
if (from > 0 && from < 6) {
from--;
} else {
from = 1; // prevent big problem
}
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveSingle - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use (the FROM tee time)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 1 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req); // first call here - reject as busy
return;
}
//
// Ok - get current 'FROM' player info from the parm block (set by checkInUse) and save it
//
player[0] = slotParms.player1;
player[1] = slotParms.player2;
player[2] = slotParms.player3;
player[3] = slotParms.player4;
player[4] = slotParms.player5;
pcw[0] = slotParms.p1cw;
pcw[1] = slotParms.p2cw;
pcw[2] = slotParms.p3cw;
pcw[3] = slotParms.p4cw;
pcw[4] = slotParms.p5cw;
user[0] = slotParms.user1;
user[1] = slotParms.user2;
user[2] = slotParms.user3;
user[3] = slotParms.user4;
user[4] = slotParms.user5;
hndcp[0] = slotParms.hndcp1;
hndcp[1] = slotParms.hndcp2;
hndcp[2] = slotParms.hndcp3;
hndcp[3] = slotParms.hndcp4;
hndcp[4] = slotParms.hndcp5;
show[0] = slotParms.show1;
show[1] = slotParms.show2;
show[2] = slotParms.show3;
show[3] = slotParms.show4;
show[4] = slotParms.show5;
mNum[0] = slotParms.mNum1;
mNum[1] = slotParms.mNum2;
mNum[2] = slotParms.mNum3;
mNum[3] = slotParms.mNum4;
mNum[4] = slotParms.mNum5;
userg[0] = slotParms.userg1;
userg[1] = slotParms.userg2;
userg[2] = slotParms.userg3;
userg[3] = slotParms.userg4;
userg[4] = slotParms.userg5;
p9[0] = slotParms.p91;
p9[1] = slotParms.p92;
p9[2] = slotParms.p93;
p9[3] = slotParms.p94;
p9[4] = slotParms.p95;
pos[0] = slotParms.pos1;
pos[1] = slotParms.pos2;
pos[2] = slotParms.pos3;
pos[3] = slotParms.pos4;
pos[4] = slotParms.pos5;
slotParms.player1 = ""; // init parmSlot player fields (verifySlot will fill)
slotParms.player2 = "";
slotParms.player3 = "";
slotParms.player4 = "";
slotParms.player5 = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.to_time == 0 || slotParms.to_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveSingle2 - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.to_time+ ", course= " +slotParms.to_course+ ", fb= " +slotParms.to_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Now check if the 'TO' tee time is currently in use (this will put its info in slotParms)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 2 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
//
// If 'TO' tee time is in use
//
if (in_use != 0) {
//
// Error - We must free up the 'FROM' tee time
//
try {
PreparedStatement pstmt4 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = 0 " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt4.clearParameters(); // clear the parms
pstmt4.setLong(1, date);
pstmt4.setInt(2, slotParms.from_time);
pstmt4.setInt(3, slotParms.from_fb);
pstmt4.setString(4, slotParms.from_course);
pstmt4.executeUpdate(); // execute the prepared stmt
pstmt4.close();
}
catch (Exception ignore) {
}
teeBusy(out, slotParms, req);
return;
}
//
// If user was prompted and opted to return w/o changes, then we must clear the 'in_use' flags
// before returning to the tee sheet.
//
if (prompt.equals( "return" )) { // if prompt specified a return
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
// return to Proshop_dlott
out.println("<HTML><HEAD><Title>Proshop Edit Lottery Complete</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&email=" + slotParms.sendEmail + "&jump=" + slotParms.jump + "&hide=" +hide+ "&lott_name=" +slotParms.lottery+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<BR><BR><H2>Return Accepted</H2>");
out.println("<BR><BR>Thank you, click Return' below if this does not automatically return.<BR>");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} else { // not a 'return' response from prompt
//
// This is either the first time here, or a 'Continue' reply to a prompt
//
p[0] = slotParms.player1; // save 'TO' player names
p[1] = slotParms.player2;
p[2] = slotParms.player3;
p[3] = slotParms.player4;
p[4] = slotParms.player5;
//
// Make sure there are no duplicate names
//
if (!user[from].equals( "" )) { // if player is a member
if ((player[from].equalsIgnoreCase( p[0] )) || (player[from].equalsIgnoreCase( p[1] )) ||
(player[from].equalsIgnoreCase( p[2] )) || (player[from].equalsIgnoreCase( p[3] )) ||
(player[from].equalsIgnoreCase( p[4] ))) {
//
// Error - name already exists
//
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
out.println(SystemUtils.HeadTitle("Player Move Error"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Player Move Error</H3>");
out.println("<BR><BR>Sorry, but the selected player is already scheduled at the time you are moving to.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// If any skips are set, then we've already been through here.
//
if (skip == 0) {
//
// Check if 'TO' tee time position is empty
//
if (!p[to].equals( "" )) {
//
// Tee time is occupied - inform user and ask to continue or cancel
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Tee Time Position is Occupied</H3><BR>");
out.println("<BR>WARNING: The tee time position you are trying to move TO is already occupied.");
out.println("<BR><BR>If you continue, the current player in this position (" +p[to]+ ") will be replaced.");
out.println("<BR><BR>Would you like to continue and replace this player?");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"1\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// *******************************************************************************
// Check 5-somes allowed on 'to course' if moving to player5 slot
// *******************************************************************************
//
if (to == 4) { // if player being moved to player5 slot
fives = 0;
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 WHERE courseName = ?");
pstmtc.clearParameters(); // clear the parms
pstmtc.setString(1, slotParms.to_course);
rs = pstmtc.executeQuery(); // execute the prepared stmt
if (rs.next()) {
fives = rs.getInt("fives");
}
pstmtc.close();
}
catch (Exception e) {
}
if (fives == 0) { // if 5-somes not allowed on to_course
out.println(SystemUtils.HeadTitle("Player Move Error"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Player Move Error</H3>");
out.println("<BR><BR>Sorry, but the course you are moving the player to does not support 5-somes.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
}
//
// check if we are to skip this test
//
if (skip < 2) {
//
// *******************************************************************************
// Check member restrictions in 'TO' tee time, but 'FROM' players
//
// First, find all restrictions within date & time constraints on this course.
// Then, find the ones for this day.
// Then, find any for this member type or membership type (all 5 players).
//
// *******************************************************************************
//
//
// allocate and setup new parm block to hold the tee time parms for this process
//
parmSlot slotParms2 = new parmSlot(); // allocate a parm block
slotParms2.date = date; // get 'TO' info
slotParms2.time = slotParms.to_time;
slotParms2.course = slotParms.to_course;
slotParms2.fb = slotParms.to_fb;
slotParms2.day = slotParms.day;
slotParms2.player1 = player[from]; // get 'FROM' player (only check this player)
try {
verifySlot.parseGuests(slotParms2, con); // check for guest and set guest type
error = verifySlot.parseNames(slotParms2, "pro"); // get the name (lname, fname, mi)
verifySlot.getUsers(slotParms2, con); // get the mship and mtype info (needs lname, fname, mi)
error = false; // init error indicator
error = verifySlot.checkMemRests(slotParms2, con); // check restrictions
}
catch (Exception ignore) {
}
if (error == true) { // if we hit on a restriction
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>" +player[from]+ "</b> is restricted from playing during this time.<br><br>");
out.println("This time slot has the following restriction: <b>" + slotParms2.rest_name + "</b><br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"2\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 3) {
//
// *******************************************************************************
// Check 5-some restrictions - use 'FROM' player5 and 'TO' tee time slot
//
// If moving to position 5 & 5-somes are restricted during this tee time, warn the proshop user.
// *******************************************************************************
//
if ((to == 4) && (!slotParms.rest5.equals( "" ))) { // if 5-somes restricted prompt user to skip test
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are restricted during this time.<br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"3\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
} // end of IF 'return' reply from prompt
//
// OK to move player - move 'FROM' player info into this tee time (TO position)
//
to++; // change index back to position value
String moveP1 = "UPDATE teecurr2 SET player" +to+ " = ?, username" +to+ " = ?, p" +to+ "cw = ?, in_use = 0, hndcp" +to+ " = ?, show" +to+ " = ?, mNum" +to+ " = ?, userg" +to+ " = ?, p9" +to+ " = ?, pos" +to+ " = ? WHERE date = ? AND time = ? AND fb = ? AND courseName=?";
try {
pstmt6 = con.prepareStatement (moveP1);
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, player[from]);
pstmt6.setString(2, user[from]);
pstmt6.setString(3, pcw[from]);
pstmt6.setFloat(4, hndcp[from]);
pstmt6.setShort(5, show[from]);
pstmt6.setString(6, mNum[from]);
pstmt6.setString(7, userg[from]);
pstmt6.setInt(8, p9[from]);
pstmt6.setShort(9, pos[from]);
pstmt6.setLong(10, date);
pstmt6.setInt(11, slotParms.to_time);
pstmt6.setInt(12, slotParms.to_fb);
pstmt6.setString(13, slotParms.to_course);
pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
if (slotParms.sendEmail.equalsIgnoreCase( "yes" )) { // if ok to send emails
sendemail = 1; // send email notification
}
//
// Track the history of this tee time - make entry in 'teehist' table (first, get the new players)
//
pstmt6 = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setLong(1, date);
pstmt6.setInt(2, slotParms.to_time);
pstmt6.setInt(3, slotParms.to_fb);
pstmt6.setString(4, slotParms.to_course);
rs = pstmt6.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
player[4] = rs.getString(5);
}
pstmt6.close();
fullName = "Edit Tsheet Move Player From " +slotParms.from_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.to_time, slotParms.to_fb, slotParms.to_course, player[0], player[1], player[2],
player[3], player[4], slotParms.user, fullName, 1, con);
}
catch (Exception e1) {
String eMsg = "Error 3 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Finally, set the 'FROM' tee time to NOT in use and clear out the player info
//
String moveP2 = "UPDATE teecurr2 SET player" +fr+ " = '', username" +fr+ " = '', p" +fr+ "cw = '', in_use = 0, show" +fr+ " = 0, mNum" +fr+ " = '', userg" +fr+ " = '', pos" +fr+ " = 0 WHERE date = ? AND time = ? AND fb = ? AND courseName=?";
try {
PreparedStatement pstmt5 = con.prepareStatement (moveP2);
pstmt5.clearParameters(); // clear the parms
pstmt5.setLong(1, date);
pstmt5.setInt(2, slotParms.from_time);
pstmt5.setInt(3, slotParms.from_fb);
pstmt5.setString(4, slotParms.from_course);
pstmt5.executeUpdate(); // execute the prepared stmt
pstmt5.close();
//
// Track the history of this tee time - make entry in 'teehist' table (first get the new player list)
//
pstmt6 = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setLong(1, date);
pstmt6.setInt(2, slotParms.from_time);
pstmt6.setInt(3, slotParms.from_fb);
pstmt6.setString(4, slotParms.from_course);
rs = pstmt6.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
player[4] = rs.getString(5);
}
pstmt6.close();
fullName = "Edit Tsheet Move Player To " +slotParms.to_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.from_time, slotParms.from_fb, slotParms.from_course, player[0], player[1], player[2],
player[3], player[4], slotParms.user, fullName, 1, con);
}
catch (Exception e1) {
String eMsg = "Error 4 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
try {
resp.flushBuffer(); // force the repsonse to complete
}
catch (Exception ignore) {
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
if (sendemail != 0) {
try { // get the new 'to' tee time values
PreparedStatement pstmt5b = con.prepareStatement (
"SELECT player1, player2, player3, player4, username1, username2, username3, " +
"username4, p1cw, p2cw, p3cw, p4cw, " +
"player5, username5, p5cw, p91, p92, p93, p94, p95 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt5b.clearParameters(); // clear the parms
pstmt5b.setLong(1, date);
pstmt5b.setInt(2, slotParms.to_time);
pstmt5b.setInt(3, slotParms.to_fb);
pstmt5b.setString(4, slotParms.to_course);
rs = pstmt5b.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
user[0] = rs.getString(5);
user[1] = rs.getString(6);
user[2] = rs.getString(7);
user[3] = rs.getString(8);
pcw[0] = rs.getString(9);
pcw[1] = rs.getString(10);
pcw[2] = rs.getString(11);
pcw[3] = rs.getString(12);
player[4] = rs.getString(13);
user[4] = rs.getString(14);
pcw[4] = rs.getString(15);
p9[0] = rs.getInt(16);
p9[1] = rs.getInt(17);
p9[2] = rs.getInt(18);
p9[3] = rs.getInt(19);
p9[4] = rs.getInt(20);
}
pstmt5b.close();
}
catch (Exception ignoree) {
}
//
// allocate a parm block to hold the email parms
//
parmEmail parme = new parmEmail(); // allocate an Email parm block
//
// Set the values in the email parm block
//
parme.type = "tee"; // type = Move Single tee time (use tee and emailMod)
parme.date = date;
parme.time = slotParms.to_time;
parme.to_time = 0;
parme.from_time = 0;
parme.fb = slotParms.to_fb;
parme.to_fb = 0;
parme.from_fb = 0;
parme.to_course = slotParms.to_course;
parme.from_course = slotParms.from_course;
parme.mm = slotParms.mm;
parme.dd = slotParms.dd;
parme.yy = slotParms.yy;
parme.user = slotParms.user;
parme.emailNew = 0;
parme.emailMod = 1;
parme.emailCan = 0;
parme.p91 = p9[0];
parme.p92 = p9[1];
parme.p93 = p9[2];
parme.p94 = p9[3];
parme.p95 = p9[4];
parme.day = slotParms.day;
parme.player1 = player[0];
parme.player2 = player[1];
parme.player3 = player[2];
parme.player4 = player[3];
parme.player5 = player[4];
parme.oldplayer1 = slotParms.player1;
parme.oldplayer2 = slotParms.player2;
parme.oldplayer3 = slotParms.player3;
parme.oldplayer4 = slotParms.player4;
parme.oldplayer5 = slotParms.player5;
parme.user1 = user[0];
parme.user2 = user[1];
parme.user3 = user[2];
parme.user4 = user[3];
parme.user5 = user[4];
parme.olduser1 = slotParms.user1;
parme.olduser2 = slotParms.user2;
parme.olduser3 = slotParms.user3;
parme.olduser4 = slotParms.user4;
parme.olduser5 = slotParms.user5;
parme.pcw1 = pcw[0];
parme.pcw2 = pcw[1];
parme.pcw3 = pcw[2];
parme.pcw4 = pcw[3];
parme.pcw5 = pcw[4];
parme.oldpcw1 = slotParms.p1cw;
parme.oldpcw2 = slotParms.p2cw;
parme.oldpcw3 = slotParms.p3cw;
parme.oldpcw4 = slotParms.p4cw;
parme.oldpcw5 = slotParms.p5cw;
//
// Send the email
//
sendEmail.sendIt(parme, con); // in common
} // end of IF sendemail
} // end of moveSingle
/**
//************************************************************************
//
// Get tee time data
//
//************************************************************************
**/
private void getTeeTimeData(long date, int time, int fb, String course, parmSlot slotParms, Connection con)
throws Exception {
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
try {
pstmt = con.prepareStatement (
"SELECT * " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt.clearParameters(); // clear the parms
pstmt.setLong(1, date); // put the parm in pstmt
pstmt.setInt(2, time);
pstmt.setInt(3, fb);
pstmt.setString(4, course);
rs = pstmt.executeQuery(); // execute the prepared stmt
if (rs.next()) {
slotParms.player1 = rs.getString( "player1" );
slotParms.player2 = rs.getString( "player2" );
slotParms.player3 = rs.getString( "player3" );
slotParms.player4 = rs.getString( "player4" );
slotParms.user1 = rs.getString( "username1" );
slotParms.user2 = rs.getString( "username2" );
slotParms.user3 = rs.getString( "username3" );
slotParms.user4 = rs.getString( "username4" );
slotParms.p1cw = rs.getString( "p1cw" );
slotParms.p2cw = rs.getString( "p2cw" );
slotParms.p3cw = rs.getString( "p3cw" );
slotParms.p4cw = rs.getString( "p4cw" );
slotParms.last_user = rs.getString( "in_use_by" );
slotParms.hndcp1 = rs.getFloat( "hndcp1" );
slotParms.hndcp2 = rs.getFloat( "hndcp2" );
slotParms.hndcp3 = rs.getFloat( "hndcp3" );
slotParms.hndcp4 = rs.getFloat( "hndcp4" );
slotParms.show1 = rs.getShort( "show1" );
slotParms.show2 = rs.getShort( "show2" );
slotParms.show3 = rs.getShort( "show3" );
slotParms.show4 = rs.getShort( "show4" );
slotParms.player5 = rs.getString( "player5" );
slotParms.user5 = rs.getString( "username5" );
slotParms.p5cw = rs.getString( "p5cw" );
slotParms.hndcp5 = rs.getFloat( "hndcp5" );
slotParms.show5 = rs.getShort( "show5" );
slotParms.notes = rs.getString( "notes" );
slotParms.hide = rs.getInt( "hideNotes" );
slotParms.rest5 = rs.getString( "rest5" );
slotParms.mNum1 = rs.getString( "mNum1" );
slotParms.mNum2 = rs.getString( "mNum2" );
slotParms.mNum3 = rs.getString( "mNum3" );
slotParms.mNum4 = rs.getString( "mNum4" );
slotParms.mNum5 = rs.getString( "mNum5" );
slotParms.userg1 = rs.getString( "userg1" );
slotParms.userg2 = rs.getString( "userg2" );
slotParms.userg3 = rs.getString( "userg3" );
slotParms.userg4 = rs.getString( "userg4" );
slotParms.userg5 = rs.getString( "userg5" );
slotParms.orig_by = rs.getString( "orig_by" );
slotParms.conf = rs.getString( "conf" );
slotParms.p91 = rs.getInt( "p91" );
slotParms.p92 = rs.getInt( "p92" );
slotParms.p93 = rs.getInt( "p93" );
slotParms.p94 = rs.getInt( "p94" );
slotParms.p95 = rs.getInt( "p95" );
slotParms.pos1 = rs.getShort( "pos1" );
slotParms.pos2 = rs.getShort( "pos2" );
slotParms.pos3 = rs.getShort( "pos3" );
slotParms.pos4 = rs.getShort( "pos4" );
slotParms.pos5 = rs.getShort( "pos5" );
}
pstmt.close();
}
catch (Exception e) {
throw new Exception("Error getting tee time data - Proshop_dlott.getTeeTimeData - Exception: " + e.getMessage());
}
}
// *********************************************************
// Done
// *********************************************************
private void editDone(PrintWriter out, parmSlot slotParms, HttpServletResponse resp, HttpServletRequest req) {
String hide = req.getParameter("hide");
try {
String url="/" +rev+ "/servlet/Proshop_dlott?index=" +slotParms.ind+ "&course=" + slotParms.returnCourse + "&jump=" + slotParms.jump + "&email=" + slotParms.sendEmail + "&hide=" +hide+ "&lott_name=" + slotParms.lottery;
resp.sendRedirect(url);
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H3>System Error</H3>");
out.println("<BR><BR>A system error occurred while trying to return to the edit tee sheet.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, please contact customer support.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +slotParms.ind+ "&course=" +slotParms.returnCourse+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
}
// *********************************************************
// Tee Time Busy Error
// *********************************************************
private void teeBusy(PrintWriter out, parmSlot slotParms, HttpServletRequest req) {
String hide = req.getParameter("hide");
out.println(SystemUtils.HeadTitle("DB Record In Use Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H2>Tee Time Slot Busy</H2>");
out.println("<BR><BR>Sorry, but this tee time slot is currently busy.");
out.println("<BR><BR>If you are attempting to move a player to another position within the same tee time,");
out.println("<BR>you will have to Return to the Tee Sheet and select that tee time to update it.");
out.println("<BR><BR>Otherwise, please select another time or try again later.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Back to Lottery\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Tee Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
// *********************************************************
// Database Error
// *********************************************************
private void dbError(PrintWriter out, Exception e1, int index, String course, String eMsg) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, please contact customer support.");
out.println("<BR><BR>Error in dbError in Proshop_dlott:");
out.println("<BR><BR>" + eMsg + " Exc= " + e1.getMessage());
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +index+ "&course=" +course+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
// *********************************************************
// Send any unsent emails
// *********************************************************
private void sendLotteryEmails2(String clubName, PrintWriter out, Connection con) {
Statement estmt = null;
Statement stmtN = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtd = null;
PreparedStatement pstmtd2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
String errorMsg = "";
String course = "";
String day = "";
int time = 0;
int atime1 = 0;
int atime2 = 0;
int atime3 = 0;
int atime4 = 0;
int atime5 = 0;
int groups = 0;
int dd = 0;
int mm = 0;
int yy = 0;
int afb = 0;
int afb2 = 0;
int afb3 = 0;
int afb4 = 0;
int afb5 = 0;
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
String g1user1 = user1;
String g1user2 = user2;
String g1user3 = user3;
String g1user4 = user4;
String g1user5 = "";
String g1player1 = player1;
String g1player2 = player2;
String g1player3 = player3;
String g1player4 = player4;
String g1player5 = "";
String g1p1cw = p1cw;
String g1p2cw = p2cw;
String g1p3cw = p3cw;
String g1p4cw = p4cw;
String g1p5cw = "";
String g1userg1 = userg1;
String g1userg2 = userg2;
String g1userg3 = userg3;
String g1userg4 = userg4;
String g1userg5 = "";
int g1p91 = p91;
int g1p92 = p92;
int g1p93 = p93;
int g1p94 = p94;
int g1p95 = 0;
String g2user1 = "";
String g2user2 = "";
String g2user3 = "";
String g2user4 = "";
String g2user5 = "";
String g2player1 = "";
String g2player2 = "";
String g2player3 = "";
String g2player4 = "";
String g2player5 = "";
String g2p1cw = "";
String g2p2cw = "";
String g2p3cw = "";
String g2p4cw = "";
String g2p5cw = "";
String g2userg1 = "";
String g2userg2 = "";
String g2userg3 = "";
String g2userg4 = "";
String g2userg5 = "";
int g2p91 = 0;
int g2p92 = 0;
int g2p93 = 0;
int g2p94 = 0;
int g2p95 = 0;
String g3user1 = "";
String g3user2 = "";
String g3user3 = "";
String g3user4 = "";
String g3user5 = "";
String g3player1 = "";
String g3player2 = "";
String g3player3 = "";
String g3player4 = "";
String g3player5 = "";
String g3p1cw = "";
String g3p2cw = "";
String g3p3cw = "";
String g3p4cw = "";
String g3p5cw = "";
String g3userg1 = "";
String g3userg2 = "";
String g3userg3 = "";
String g3userg4 = "";
String g3userg5 = "";
int g3p91 = 0;
int g3p92 = 0;
int g3p93 = 0;
int g3p94 = 0;
int g3p95 = 0;
String g4user1 = "";
String g4user2 = "";
String g4user3 = "";
String g4user4 = "";
String g4user5 = "";
String g4player1 = "";
String g4player2 = "";
String g4player3 = "";
String g4player4 = "";
String g4player5 = "";
String g4p1cw = "";
String g4p2cw = "";
String g4p3cw = "";
String g4p4cw = "";
String g4p5cw = "";
String g4userg1 = "";
String g4userg2 = "";
String g4userg3 = "";
String g4userg4 = "";
String g4userg5 = "";
int g4p91 = 0;
int g4p92 = 0;
int g4p93 = 0;
int g4p94 = 0;
int g4p95 = 0;
String g5user1 = "";
String g5user2 = "";
String g5user3 = "";
String g5user4 = "";
String g5user5 = "";
String g5player1 = "";
String g5player2 = "";
String g5player3 = "";
String g5player4 = "";
String g5player5 = "";
String g5p1cw = "";
String g5p2cw = "";
String g5p3cw = "";
String g5p4cw = "";
String g5p5cw = "";
String g5userg1 = "";
String g5userg2 = "";
String g5userg3 = "";
String g5userg4 = "";
String g5userg5 = "";
int g5p91 = 0;
int g5p92 = 0;
int g5p93 = 0;
int g5p94 = 0;
int g5p95 = 0;
//*****************************************************************************
// Send an email to all in this request
//*****************************************************************************
//
try {
estmt = con.createStatement(); // create a statement
rs = estmt.executeQuery("" +
"SELECT * " +
"FROM teecurr2 " +
"WHERE lottery = ? AND lottery_email <> 0;");
while (rs.next()) {
player1 = rs.getString("player1");
player2 = rs.getString("player2");
player3 = rs.getString("player3");
player4 = rs.getString("player4");
player5 = rs.getString("player5");
user1 = rs.getString("username1");
user2 = rs.getString("username2");
user3 = rs.getString("username3");
user4 = rs.getString("username4");
user5 = rs.getString("username5");
p1cw = rs.getString("p1cw");
p2cw = rs.getString("p2cw");
p3cw = rs.getString("p3cw");
p4cw = rs.getString("p4cw");
p5cw = rs.getString("p5cw");
//
// Get today's date and time for email processing
//
Calendar ecal = new GregorianCalendar(); // get todays date
int eyear = ecal.get(Calendar.YEAR);
int emonth = ecal.get(Calendar.MONTH);
int eday = ecal.get(Calendar.DAY_OF_MONTH);
int e_hourDay = ecal.get(Calendar.HOUR_OF_DAY);
int e_min = ecal.get(Calendar.MINUTE);
int e_time = 0;
long e_date = 0;
//
// Build the 'time' string for display
//
// Adjust the time based on the club's time zone (we are Central)
//
e_time = (e_hourDay * 100) + e_min;
e_time = SystemUtils.adjustTime(con, e_time); // adjust for time zone
if (e_time < 0) { // if negative, then we went back or ahead one day
e_time = 0 - e_time; // convert back to positive value
if (e_time < 100) { // if hour is zero, then we rolled ahead 1 day
//
// roll cal ahead 1 day (its now just after midnight, the next day Eastern Time)
//
ecal.add(Calendar.DATE,1); // get next day's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
} else { // we rolled back 1 day
//
// roll cal back 1 day (its now just before midnight, yesterday Pacific or Mountain Time)
//
ecal.add(Calendar.DATE,-1); // get yesterday's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
}
}
int e_hour = e_time / 100; // get adjusted hour
e_min = e_time - (e_hour * 100); // get minute value
int e_am_pm = 0; // preset to AM
if (e_hour > 11) {
e_am_pm = 1; // PM
e_hour = e_hour - 12; // set to 12 hr clock
}
if (e_hour == 0) {
e_hour = 12;
}
String email_time = "";
emonth = emonth + 1; // month starts at zero
e_date = (eyear * 10000) + (emonth * 100) + eday;
//
// get date/time string for email message
//
if (e_am_pm == 0) {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " AM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " AM";
}
} else {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " PM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " PM";
}
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
String to = ""; // to address
String f_b = "";
String eampm = "";
String etime = "";
String enewMsg = "";
int emailOpt = 0; // user's email option parm
int ehr = 0;
int emin = 0;
int send = 0;
PreparedStatement pstmte1 = null;
//
// set the front/back value
//
f_b = "Front";
if (afb == 1) {
f_b = "Back";
}
String enew1 = "";
String enew2 = "";
String subject = "";
if (clubName.startsWith( "Old Oaks" )) {
enew1 = "The following Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Tee Time Assignment Notification";
} else {
if (clubName.startsWith( "Westchester" )) {
enew1 = "The following Draw Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Draw Tee Times have been ASSIGNED.\n\n";
subject = "Your Tee Time for Weekend Draw";
} else {
enew1 = "The following Lottery Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Lottery Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Lottery Assignment Notification";
}
}
if (!clubName.equals( "" )) {
subject = subject + " - " + clubName;
}
Properties properties = new Properties();
properties.put("mail.smtp.host", SystemUtils.host); // set outbound host address
properties.put("mail.smtp.port", SystemUtils.port); // set outbound port
properties.put("mail.smtp.auth", "true"); // set 'use authentication'
Session mailSess = Session.getInstance(properties, SystemUtils.getAuthenticator()); // get session properties
MimeMessage message = new MimeMessage(mailSess);
try {
message.setFrom(new InternetAddress(SystemUtils.EFROM)); // set from addr
message.setSubject( subject ); // set subject line
message.setSentDate(new java.util.Date()); // set date/time sent
}
catch (Exception ignore) {
}
//
// Set the recipient addresses
//
if (!g1user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
//
// send email if anyone to send it to
//
if (send != 0) { // if any email addresses specified for members
//
// Create the message content
//
if (groups > 1) {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
} else {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
}
if (!course.equals( "" )) {
enewMsg = enewMsg + "of Course: " + course;
}
//
// convert time to hour and minutes for email msg
//
time = atime1; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n at " + etime + "\n";
if (!g1player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g1player1 + " " + g1p1cw;
}
if (!g1player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g1player2 + " " + g1p2cw;
}
if (!g1player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g1player3 + " " + g1p3cw;
}
if (!g1player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g1player4 + " " + g1p4cw;
}
if (!g1player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g1player5 + " " + g1p5cw;
}
if (groups > 1) {
time = atime2; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g2player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g2player1 + " " + g2p1cw;
}
if (!g2player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g2player2 + " " + g2p2cw;
}
if (!g2player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g2player3 + " " + g2p3cw;
}
if (!g2player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g2player4 + " " + g2p4cw;
}
if (!g2player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g2player5 + " " + g2p5cw;
}
}
if (groups > 2) {
time = atime3; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g3player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g3player1 + " " + g3p1cw;
}
if (!g3player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g3player2 + " " + g3p2cw;
}
if (!g3player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g3player3 + " " + g3p3cw;
}
if (!g3player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g3player4 + " " + g3p4cw;
}
if (!g3player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g3player5 + " " + g3p5cw;
}
}
if (groups > 3) {
time = atime4; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g4player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g4player1 + " " + g4p1cw;
}
if (!g4player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g4player2 + " " + g4p2cw;
}
if (!g4player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g4player3 + " " + g4p3cw;
}
if (!g4player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g4player4 + " " + g4p4cw;
}
if (!g4player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g4player5 + " " + g4p5cw;
}
}
if (groups > 4) {
time = atime5; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g5player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g5player1 + " " + g5p1cw;
}
if (!g5player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g5player2 + " " + g5p2cw;
}
if (!g5player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g5player3 + " " + g5p3cw;
}
if (!g5player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g5player4 + " " + g5p4cw;
}
if (!g5player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g5player5 + " " + g5p5cw;
}
}
enewMsg = enewMsg + SystemUtils.trailer;
try {
message.setText( enewMsg ); // put msg in email text area
Transport.send(message); // send it!!
}
catch (Exception ignore) {
}
} // end of IF send
} // end while loop for teecurr2
estmt.close();
}
catch (Exception ignore) {
}
}
private void sendLotteryEmails(String clubName, PrintWriter out, Connection con) {
parmEmail parme = new parmEmail(); // allocate an Email parm block
ResultSet rs = null;
Statement stmt = null;
}
} // end servlet | UTF-8 | Java | 452,760 | java | Copy (2) of Proshop_dlott.java | Java | [
{
"context": "d (on doGet): \r\n *\r\n *\r\n * created: 3/22/2007 Paul S.\r\n *\r\n * last updated:\r\n *\r\n *\r\n *\r\n ***********",
"end": 268,
"score": 0.999626100063324,
"start": 262,
"tag": "NAME",
"value": "Paul S"
},
{
"context": "5\");\r\n slotParms.user1 ... | null | [] | /***************************************************************************************
* Proshop_dlott: This servlet will process the Lottery requests
*
*
* called by:
*
*
* parms passed (on doGet):
*
*
* created: 3/22/2007 <NAME>.
*
* last updated:
*
*
*
***************************************************************************************
*/
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.util.zip.*;
import java.sql.*;
import java.lang.Math;
import javax.mail.internet.*;
import javax.mail.*;
import javax.activation.*;
// foretees imports
import com.foretees.common.parmSlot;
import com.foretees.common.parmClub;
import com.foretees.common.verifySlot;
import com.foretees.common.parmCourse;
import com.foretees.common.getParms;
import com.foretees.common.getClub;
import com.foretees.common.parmEmail;
import com.foretees.common.sendEmail;
public class Proshop_dlott extends HttpServlet {
String rev = SystemUtils.REVLEVEL; // Software Revision Level (Version)
String delim = "_";
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setHeader("Pragma", "no-cache"); // these 3 added to fix 'blank screen' problem
resp.setHeader("Cache-Control", "no-cache");
resp.setDateHeader("Expires", 0);
resp.setContentType("text/html");
PrintWriter out;
PreparedStatement pstmtc = null;
Statement stmt = null;
Statement stmtc = null;
ResultSet rs = null;
ResultSet rs2 = null;
//
// use GZip (compression) if supported by browser
//
String encodings = req.getHeader("Accept-Encoding"); // browser encodings
if ((encodings != null) && (encodings.indexOf("gzip") != -1)) { // if browser supports gzip
OutputStream out1 = resp.getOutputStream();
out = new PrintWriter(new GZIPOutputStream(out1), false); // use compressed output stream
resp.setHeader("Content-Encoding", "gzip"); // indicate gzip
} else {
out = resp.getWriter(); // normal output stream
}
HttpSession session = SystemUtils.verifyPro(req, out); // check for intruder
if (session == null) {
out.println(SystemUtils.HeadTitle("Access Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>System Access Error</H3>");
out.println("<BR><BR>You have entered this site incorrectly or have lost your session cookie.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
Connection con = SystemUtils.getCon(session); // get DB connection
if (con == null) {
out.println(SystemUtils.HeadTitle("DB Connection Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>Database Connection Error</H3>");
out.println("<BR><BR>Unable to connect to the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// Check for 'Insert' or 'Delete' request
//
if (req.getParameter("insert") != null) {
doInsert(req, out, con, session); // process insert request
return;
}
if (req.getParameter("delete") != null) {
if (req.getParameter("lotteryId") != null) {
doDeleteLottery(req, out, con, session);
} else {
doDelete(req, out, con, session);
}
return;
}
//
// get name of club for this user
//
String club = (String)session.getAttribute("club");
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// parm block to hold the club parameters
//
parmClub parm = new parmClub(); // allocate a parm block
//
// parm block to hold the course parameters
//
parmCourse parmc = new parmCourse(); // allocate a parm block
String event = "";
String ecolor = "";
String rest = "";
String rcolor = "";
String rest_recurr = "";
String rest5 = "";
String bgcolor5 = "";
String player = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String p1 = "";
String p2 = "";
String p3 = "";
String p4 = "";
String p5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String ampm = "";
String event_rest = "";
String bgcolor = "";
String stime = "";
String sshow = "";
String sfb = "";
String submit = "";
String num = "";
String jumps = "";
String hole = "";
String event1 = ""; // for legend - max 2 events, 4 rest's, 2 lotteries
String ecolor1 = "";
String rest1 = "";
String rcolor1 = "";
String event2 = "";
String ecolor2 = "";
String rest2 = "";
String rcolor2 = "";
String rest3 = "";
String rcolor3 = "";
String rest4 = "";
String rcolor4 = "";
String blocker = "";
String bag = "";
String conf = "";
String orig_by = "";
String orig_name = "";
String errMsg = "";
String emailOpt = "";
String lottery_color = "";
String lottery = "";
String lottery_recurr = "";
String lott = "";
String lott1 = "";
String lott2 = "";
String lott3 = "";
String lott_color = "";
String lott_color2 = "";
String lott_recurr = "";
String lcolor1 = "";
String lcolor2 = "";
String lcolor3 = "";
int jump = 0;
int j = 0;
int i = 0;
int hr = 0;
int min = 0;
int time = 0;
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int type = 0;
int in_use = 0;
int fives = 0;
int fivesALL = 0;
int teecurr_id = 0;
int shotgun = 1;
int g1 = 0;
int g2 = 0;
int g3 = 0;
int g4 = 0;
int g5 = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
short fb = 0;
int lott_start_time = 0;
int lott_end_time = 0;
//
// Array to hold the course names
//
int cMax = 21;
String [] courseA = new String [cMax]; // max of 20 courses per club
String courseName = ""; // max of 20 courses per club
String courseName1 = "";
String courseT = "";
int tmp_i = 0;
int [] fivesA = new int [cMax]; // array to hold 5-some option for each course
String [] course_color = new String [cMax];
// set default course colors // NOTE: CHANES TO THIS ARRAY NEED TO BE DUPLICATED IN Proshop_sheet.java
course_color[0] = "#F5F5DC"; // beige shades
course_color[1] = "#DDDDBE";
course_color[2] = "#B3B392";
course_color[3] = "#8B8970";
course_color[4] = "#E7F0E7"; // greens shades
course_color[5] = "#C6D3C6";
course_color[6] = "#648A64";
course_color[7] = "#407340";
course_color[8] = "#FFE4C4"; // bisque
course_color[9] = "#95B795";
course_color[10] = "#66CDAA"; // medium aquamarine
course_color[11] = "#20B2AA"; // light seagreen
course_color[12] = "#3CB371"; // medium seagreen
course_color[13] = "#F5DEB3"; // wheat
course_color[14] = "#D2B48C"; // tan
course_color[15] = "#999900"; //
course_color[16] = "#FF9900"; // red-orange??
course_color[17] = "#33FF66"; //
course_color[18] = "#7FFFD4"; // aquamarine
course_color[19] = "#33FFFF"; //
course_color[20] = "#FFFFFF"; // white
String hideUnavail = req.getParameter("hide");
if (hideUnavail == null) hideUnavail = "";
//
// Get the golf course name requested (changed to use the course specified for this lottery)
//
String course = req.getParameter("course");
if (course == null) course = "";
//
// Get the name of the lottery requested
//
String lott_name = req.getParameter("lott_name");
if (lott_name == null) lott_name = "";
//
// 'index' contains an index value representing the date selected
// (0 = today, 1 = tomorrow, etc.)
//
int index = 0;
num = req.getParameter("index"); // get the index value of the day selected
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(num);
}
catch (NumberFormatException e) { }
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead 'index' days
int cal_hour = cal.get(Calendar.HOUR_OF_DAY); // 24 hr clock (0 - 23)
int cal_min = cal.get(Calendar.MINUTE);
int cal_time = (cal_hour * 100) + cal_min; // get time in hhmm format
cal_time = SystemUtils.adjustTime(con, cal_time);
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
String day_name = day_table[day_num]; // get name for day
long date = (year * 10000) + (month * 100) + day; // create a date field of yyyymmdd
String date_mysql = year + "-" + SystemUtils.ensureDoubleDigit(month) + "-" + SystemUtils.ensureDoubleDigit(day);
String time_mysql = (cal_time / 100) + ":" + SystemUtils.ensureDoubleDigit(cal_time % 100) + ":00"; // current time for
out.println("<!-- date_mysql=" + date_mysql + " -->");
out.println("<!-- cal_time=" + cal_time + " -->");
// huge try/catch that spans entire method
try {
errMsg = "Get course names.";
//
// Get the Guest Types from the club db
//
getClub.getParms(con, parm); // get the club parms
//
// Remove any guest types that are null - for tests below
//
i = 0;
while (i < parm.MAX_Guests) {
if (parm.guest[i].equals( "" )) {
parm.guest[i] = "$@#!^&*"; // make so it won't match player name
}
i++;
} // end of while loop
//
// Get course names if multi-course facility so we can determine if any support 5-somes
//
i = 0;
int courseCount = 0;
//if (course.equals("")) {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT courseName, stime, etime " +
"FROM lottery3 " +
"WHERE name = ?");
pstmt.clearParameters();
pstmt.setString(1, lott_name);
rs = pstmt.executeQuery();
if (rs.next()) {
if (parm.multi != 0 && course.equals("")) course = rs.getString(1); // if no course was specified (default) then set the course variable to the course this lottery is for
lott_start_time = rs.getInt(2);
lott_end_time = rs.getInt(3);
}
//}
if (parm.multi != 0) { // if multiple courses supported for this club
// init the course array
while (i < cMax) {
courseA[i] = "";
i++;
}
i = 0;
int total = 0;
//
// Get the names of all courses for this club
//
pstmt = con.prepareStatement("SELECT courseName FROM clubparm2;");
pstmt.clearParameters();
rs = pstmt.executeQuery();
while (rs.next() && i < cMax) {
courseName = rs.getString(1);
courseA[i] = courseName; // add course name to array
i++;
}
pstmt.close();
if (i > cMax) { // make sure we didn't go past max
courseCount = cMax;
} else {
courseCount = i; // save number of courses
}
if (i > 1 && i < cMax) {
courseA[i] = "-ALL-"; // add '-ALL-' option
}
//
// Make sure we have a course (in case we came directly from the Today's Tee Sheet menu)
//
if (courseName1.equals( "" )) {
courseName1 = courseA[0]; // grab the first one
}
} // end if multiple courses supported
//
// Get the walk/cart options available and 5-some support
//
i = 0;
if (course.equals( "-ALL-" )) {
//
// Check all courses for 5-some support
//
loopc:
while (i < cMax) {
courseName = courseA[i]; // get a course name
if (!courseName.equals( "-ALL-" )) { // skip if -ALL-
if (courseName.equals( "" )) { // done if null
break loopc;
}
getParms.getCourse(con, parmc, courseName);
fivesA[i] = parmc.fives; // get fivesome option
if (fivesA[i] == 1) {
fives = 1;
}
}
i++;
}
} else { // single course requested
getParms.getCourse(con, parmc, course);
fives = parmc.fives; // get fivesome option
}
fivesALL = fives; // save 5-somes option for table display below
i = 0;
//
// Statements to find any restrictions, events or lotteries for today
//
String string7b = "";
String string7c = "";
String string7d = "";
if (course.equals( "-ALL-" )) {
string7b = "SELECT name, recurr, color FROM restriction2 WHERE sdate <= ? AND edate >= ? " +
"AND showit = 'Yes'";
} else {
string7b = "SELECT name, recurr, color FROM restriction2 WHERE sdate <= ? AND edate >= ? " +
"AND (courseName = ? OR courseName = '-ALL-') AND showit = 'Yes'";
}
if (course.equals( "-ALL-" )) {
string7c = "SELECT name, color FROM events2b WHERE date = ?";
} else {
string7c = "SELECT name, color FROM events2b WHERE date = ? " +
"AND (courseName = ? OR courseName = '-ALL-')";
}
if (course.equals( "-ALL-" )) {
string7d = "SELECT name, recurr, color, sdays, sdtime, edays, edtime, pdays, ptime, slots " +
"FROM lottery3 WHERE sdate <= ? AND edate >= ?";
} else {
string7d = "SELECT name, recurr, color, sdays, sdtime, edays, edtime, pdays, ptime, slots " +
"FROM lottery3 WHERE sdate <= ? AND edate >= ? " +
"AND (courseName = ? OR courseName = '-ALL-')";
}
PreparedStatement pstmt7b = con.prepareStatement (string7b);
PreparedStatement pstmt7c = con.prepareStatement (string7c);
PreparedStatement pstmt7d = con.prepareStatement (string7d);
errMsg = "Scan Restrictions.";
//
// Scan the events, restrictions and lotteries to build the legend
//
pstmt7b.clearParameters(); // clear the parms
pstmt7b.setLong(1, date);
pstmt7b.setLong(2, date);
if (!course.equals( "-ALL-" )) {
pstmt7b.setString(3, course);
}
rs = pstmt7b.executeQuery(); // find all matching restrictions, if any
while (rs.next()) {
rest = rs.getString(1);
rest_recurr = rs.getString(2);
rcolor = rs.getString(3);
//
// We must check the recurrence for this day (Monday, etc.)
//
if ((rest_recurr.equals( "Every " + day_name )) || // if this day
(rest_recurr.equalsIgnoreCase( "every day" )) || // or everyday
((rest_recurr.equalsIgnoreCase( "all weekdays" )) && // or all weekdays (and this is one)
(!day_name.equalsIgnoreCase( "saturday" )) &&
(!day_name.equalsIgnoreCase( "sunday" ))) ||
((rest_recurr.equalsIgnoreCase( "all weekends" )) && // or all weekends (and this is one)
(day_name.equalsIgnoreCase( "saturday" ))) ||
((rest_recurr.equalsIgnoreCase( "all weekends" )) &&
(day_name.equalsIgnoreCase( "sunday" )))) {
if ((!rest.equals( rest1 )) && (rest1.equals( "" ))) {
rest1 = rest;
rcolor1 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor1 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (rest2.equals( "" ))) {
rest2 = rest;
rcolor2 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor2 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (!rest.equals( rest3 )) && (rest3.equals( "" ))) {
rest3 = rest;
rcolor3 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor3 = "#F5F5DC";
}
} else {
if ((!rest.equals( rest1 )) && (!rest.equals( rest2 )) && (!rest.equals( rest3 )) &&
(!rest.equals( rest4 )) && (rest4.equals( "" ))) {
rest4 = rest;
rcolor4 = rcolor;
if (rcolor.equalsIgnoreCase( "default" )) {
rcolor4 = "#F5F5DC";
}
}
}
}
}
}
} // end of while
pstmt7b.close();
errMsg = "Scan Events.";
pstmt7c.clearParameters(); // clear the parms
pstmt7c.setLong(1, date);
if (!course.equals( "-ALL-" )) {
pstmt7c.setString(2, course);
}
rs = pstmt7c.executeQuery(); // find all matching events, if any
while (rs.next()) {
event = rs.getString(1);
ecolor = rs.getString(2);
if ((!event.equals( event1 )) && (event1.equals( "" ))) {
event1 = event;
ecolor1 = ecolor;
if (ecolor.equalsIgnoreCase( "default" )) {
ecolor1 = "#F5F5DC";
}
} else {
if ((!event.equals( event1 )) && (!event.equals( event2 )) && (event2.equals( "" ))) {
event2 = event;
ecolor2 = ecolor;
if (ecolor.equalsIgnoreCase( "default" )) {
ecolor2 = "#F5F5DC";
}
}
}
} // end of while
pstmt7c.close();
//****************************************************
// Define tee sheet size and build it
//****************************************************
// define our two arrays that describe the column sizes
// index = column number, value = size in pixels
int [] col_width = new int [15];
int col_start[] = new int[15]; // total width = 962 px (in dts-styles.css)
int [] lcol_width = new int [8];
int lcol_start[] = new int[8];
lcol_width[0] = 0; // unused
lcol_width[1] = 40; // +/-
lcol_width[2] = (course.equals( "-ALL-" )) ? 71 : 80; // desired time
lcol_width[3] = (course.equals( "-ALL-" )) ? 71 : 80; // assigned time
lcol_width[4] = 120; // acceptable time
lcol_width[5] = (course.equals( "-ALL-" )) ? 90 : 0; // course
lcol_width[6] = 40; // weight
lcol_width[7] = (fivesALL == 0) ? 410 : 560; // members
lcol_start[1] = 0;
lcol_start[2] = lcol_start[1] + lcol_width[1];
lcol_start[3] = lcol_start[2] + lcol_width[2];
lcol_start[4] = lcol_start[3] + lcol_width[3];
lcol_start[5] = lcol_start[4] + lcol_width[4];
lcol_start[6] = lcol_start[5] + lcol_width[5];
lcol_start[7] = lcol_start[6] + lcol_width[6];
if (course.equals( "-ALL-" )) {
col_width[0] = 0; // unused
col_width[1] = 40; // +/-
col_width[2] = 71; // time
col_width[3] = 90; // course name col 69
col_width[4] = 31; // f/b
col_width[5] = 111; // player 1
col_width[6] = 39; // player 1 trans opt
col_width[7] = 111; // player 2
col_width[8] = 39; // player 2 trans opt
col_width[9] = 111; // player 3
col_width[10] = 39; // player 3 trans opt
col_width[11] = 111; // player 4
col_width[12] = 39; // player 4 trans opt
col_width[13] = 111; // player 5
col_width[14] = 39; // player 5 trans opt
} else {
col_width[0] = 0; // unused
col_width[1] = 40; // +/-
col_width[2] = 80; // time
col_width[3] = 0; // empty if no course name
col_width[4] = 40; // f/b
col_width[5] = 120; // player 1
col_width[6] = 40; // player 1 trans opt
col_width[7] = 120; // player 2
col_width[8] = 40; // player 2 trans opt
col_width[9] = 120; // player 3
col_width[10] = 40; // player 3 trans opt
col_width[11] = 120; // player 4
col_width[12] = 40; // player 4 trans opt
col_width[13] = 120; // player 5
col_width[14] = 40; // player 5 trans opt
}
col_start[1] = 0;
col_start[2] = col_start[1] + col_width[1];
col_start[3] = col_start[2] + col_width[2];
col_start[4] = col_start[3] + col_width[3];
col_start[5] = col_start[4] + col_width[4];
col_start[6] = col_start[5] + col_width[5];
col_start[7] = col_start[6] + col_width[6];
col_start[8] = col_start[7] + col_width[7];
col_start[9] = col_start[8] + col_width[8];
col_start[10] = col_start[9] + col_width[9];
col_start[11] = col_start[10] + col_width[10];
col_start[12] = col_start[11] + col_width[11];
col_start[13] = col_start[12] + col_width[12];
col_start[14] = col_start[13] + col_width[13];
int total_col_width = col_start[14] + col_width[14];
// temp variable
String dts_tmp = "";
//
// Build the HTML page
//
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<html>\n<!--Copyright notice: This software (including any images, servlets, applets, photographs, animations, video, music and text incorporated into the software) ");
out.println("is the proprietary property of ForeTees, LLC or its suppliers and its use, modification and distribution are protected ");
out.println("and limited by United States copyright laws and international treaty provisions and all other applicable national laws. ");
out.println("\nReproduction is strictly prohibited.-->");
out.println("<head>");
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">");
out.println("<meta http-equiv=\"Content-Language\" content=\"en-us\">");
out.println("<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">");
out.println("<link rel=\"stylesheet\" href=\"/" +rev+ "/dts-styles.css\">");
out.println("<title>Proshop Tee Sheet Management Page</title>");
out.println("<script language=\"javascript\">"); // Jump script
out.println("<!--");
out.println("function jumpToHref(anchorstr) {");
out.println("if (location.href.indexOf(anchorstr)<0) {");
out.println(" location.href=anchorstr; }");
out.println("}");
out.println("// -->");
out.println("</script>"); // End of script
// include dts javascript source file
out.println("<script language=\"javascript\" src=\"/" +rev+ "/dts-scripts.js\"></script>");
out.println("</head>");
out.println("<body onLoad='jumpToHref(\"#jump" + jump + "\");' bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\"><center>");
out.println("<a name=\"jump0\"></a>"); // create a default jump label (start of page)
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // table for cmd tbl & instructions
out.println("<tr><td align=\"left\" valign=\"middle\">");
//
// Build Control Panel
//
out.println("<table border=\"1\" width=\"130\" cellspacing=\"3\" cellpadding=\"3\" bgcolor=\"8B8970\" align=\"left\">");
out.println("<tr>");
out.println("<td align=\"center\"><font size=\"3\"><b>Control Panel</b><br>");
out.println("</font></td></tr><tr><td align=\"center\"><font size=\"2\">");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "\" title=\"Refresh Sheet\" alt=\"Refresh Sheet\">");
out.println("Refresh Sheet</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + ((hideUnavail.equals("1") ? "" : "&hide=1")) + "\" title=\"Lottery Times Only\" alt=\"Lottery Times Only\">");
out.println((hideUnavail.equals("1") ? "Show All Tee Times" : "Show Lottery Times Only") + "</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +course+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&convert=all\" title=\"Convert All Requests\" alt=\"Convert All Requests\">");
out.println("Convert Assigned Requests</a><br>");
out.println("</font></td></tr><tr><td align=\"center\" nowrap><font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +index+ "&course=" +course+ "\" title=\"Return to Tee Sheet\" alt=\"Return\">");
out.println("Return to Tee Sheet</a><br>");
out.println("</font></td></tr></table>"); // end Control Panel table
out.println("</td>"); // end of column for control panel
out.println("<td align=\"center\" width=\"20\"> "); // empty column for spacer
out.println("</td>");
out.println("<td align=\"left\" valign=\"top\">"); // column for instructions, course selector, calendars??
//**********************************************************
// Continue with instructions and tee sheet
//**********************************************************
out.println("<table cellpadding=\"5\" cellspacing=\"3\" width=\"80%\">");
out.println("<tr><td align=\"center\">");
out.println("<p align=\"center\"><font size=\"5\">Golf Shop Lottery Management</font></p>");
out.println("</td></tr></table>");
out.println("<table cellpadding=\"3\" width=\"80%\">");
out.println("<tr><td bgcolor=\"#336633\"><font color=\"#FFFFFF\" size=\"2\">");
out.println("<b>Instructions:</b>");
out.println("To <b>insert</b> a new tee time, click on the plus icon <img src=/v5/images/dts_newrow.gif width=13 height=13 border=0> in the tee time you wish to insert <i>after</i>. ");
out.println("To <b>delete</b> a tee time, click on the trash can icon <img src=/v5/images/dts_trash.gif width=13 height=13 border=0> in the tee time you wish to delete. ");
out.println("To <b>move an entire tee time</b>, click on the 'Time' value and drag the tee time to the new position. ");
out.println("To <b>move an individual player</b>, click on the Player and drag the name to the new position. ");
out.println("To <b>change</b> the F/B value or the C/W value, just click on it and make the selection. ");
out.println("Empty 'player' cells indicate available positions. ");
out.println("Special Events and Restrictions, if any, are colored (see legend below).");
out.println("</font></td></tr></table>");
out.println("</td></tr></table>"); // end tbl for instructions
out.println("<p><font size=\"2\">");
out.println("Date: <b>" + day_name + " " + month + "/" + day + "/" + year + "</b>");
if (!course.equals( "" )) {
out.println(" Course: <b>" + course + "</b></p>");
}
//
// If multiple courses, then add a drop-down box for course names
//
String tmp_ncount = "";
out.println("<!-- courseCount=" + courseCount + " -->");
if (parm.multi != 0) { // if multiple courses supported for this club
//
// use 2 forms so you can switch by clicking either a course or a date
//
if (courseCount < 5) { // if < 5 courses, use buttons
i = 0;
courseName = courseA[i]; // get first course name from array
out.println("<p><font size=\"2\">");
out.println("<b>Select Course:</b> ");
while ((!courseName.equals( "" )) && (i < 6)) { // allow one more for -ALL-
out.println("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseName+ "&hide=" + hideUnavail + "&lott_name=" + lott_name + "\" style=\"color:blue\" target=\"_top\" title=\"Switch to new course\" alt=\"" +courseName+ "\">");
out.print(courseName + "</a>");
out.print(" ");
i++;
courseName = courseA[i]; // get course name from array
}
out.println("</p>");
}
else
{ // use drop-down menu
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" name=\"cform\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">"); // use current date
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"select\">");
i = 0;
courseName = courseA[i]; // get first course name from array
out.println("<b>Course:</b> ");
out.println("<select size=\"1\" name=\"course\" onchange=\"document.cform.submit()\">");
while ((!courseName.equals( "" )) && (i < cMax)) {
out.println("<option " + ((courseName.equals( course )) ? "selected " : "") + "value=\"" + courseName + "\">" + courseName + "</option>");
i++;
if (i < cMax) courseName = courseA[i]; // get course name from array
}
out.println("</select>");
out.println("</form>");
} // end either display href links or drop down select
} // end if multi course
if (!event1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + ecolor1 + "\">" + event1 + "</button>");
out.println(" ");
if (!event2.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + ecolor2 + "\">" + event2 + "</button>");
out.println(" ");
}
}
if (!rest1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + rcolor1 + "\">" + rest1 + "</button>");
if (!rest2.equals( "" )) {
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor2 + "\">" + rest2 + "</button>");
if (!rest3.equals( "" )) {
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor3 + "\">" + rest3 + "</button>");
if ((!rest4.equals( "" )) && (event1.equals( "" ))) { // do 4 rest's if no events
out.println(" ");
out.println("<button type=\"button\" style=\"background:" + rcolor4 + "\">" + rest4 + "</button>");
}
}
}
}
if (!lott1.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor1 + "\">Lottery Times</button>");
out.println(" ");
if (!lott2.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor2 + "\">Lottery Times</button>");
out.println(" ");
if (!lott3.equals( "" )) {
out.println("<button type=\"button\" style=\"background:" + lcolor3 + "\">Lottery Times</button>");
out.println(" ");
}
}
}
if (!event1.equals( "" ) || !rest1.equals( "" ) || !lott1.equals( "" )) {
out.println("<br>");
}
// *** these two lines came up from after tee sheet
out.println("</td></tr>");
out.println("</table>"); // end of main page table
out.println("<br>");
out.println("<font size=\"2\">");
out.println("<b>Lottery Request Legend</b>");
out.println("</font><br><font size=\"1\">");
out.println("<b>m/-:</b> c = Move to Tee Sheet, minus = Delete Request, ");
out.println("<b>Desired:</b> Desired Time, <b>Assigned:</b> System Assigned Time<br>");
out.println("<b>Acceptable:</b> Range of Acceptable Times <b>W:</b> Weight");
out.println("</font>");
out.println("</center>");
//****************************************************************************
//
// start html for display of lottery requests
//
//****************************************************************************
//
// IMAGE MARKER FOR POSITIONING
out.println("<img src=\"/"+rev+"/images/shim.gif\" width=1 height=1 border=0 id=imgMarker name=imgMarker>");
out.println("\n<!-- START OF LOTTERY REQ SHEET HEADER -->");
out.println(""); // width=" + total_col_width + " align=center
out.println("<div id=\"elHContainer2\">");
out.println("<span class=header style=\"left: " +lcol_start[1]+ "px; width: " +lcol_width[1]+ "px\">c/-</span><span");
out.println(" class=header style=\"left: " +lcol_start[2]+ "px; width: " +lcol_width[2]+ "px\">Assigned</span><span");
out.println(" class=header style=\"left: " +lcol_start[3]+ "px; width: " +lcol_width[3]+ "px\">Desired</span><span");
out.println(" class=header style=\"left: " +lcol_start[4]+ "px; width: " +lcol_width[4]+ "px\">Acceptable</span><span");
if (course.equals( "-ALL-" )) {
out.println(" class=header style=\"left: " +lcol_start[5]+ "px; width: " +lcol_width[5]+ "px\">Course</span><span ");
}
out.println(" class=header style=\"left: " +lcol_start[6]+ "px; width: " +lcol_width[6]+ "px\">W</span><span id=widthMarker2 ");
out.println(" class=header style=\"left: " +lcol_start[7]+ "px; width: " +lcol_width[7]+ "px\">Members</span>");
out.print("</div>\n");
out.println("<!-- END OF LOTTERY REQ HEADER -->\n");
out.println("\n<!-- START OF LOTTERY REQ SHEET BODY -->");
out.println("<div id=\"elContainer2\">");
errMsg = "Reading Lottery Requests";
out.println("<!-- lott_name=" + lott_name + " -->");
out.println("<!-- date=" + date + " -->");
pstmt = con.prepareStatement ("" +
"SELECT c.fives, l.* " +
"FROM lreqs3 l, clubparm2 c " +
"WHERE name = ? AND date = ? AND c.courseName = l.courseName " +
(course.equals("-ALL-") ? "" : " AND l.courseName = ? ") + " " +
"ORDER BY atime1;");
pstmt.clearParameters();
pstmt.setString(1, lott_name);
pstmt.setLong(2, date);
if (!course.equals("-ALL-")) pstmt.setString(3, course);
rs = pstmt.executeQuery();
boolean tmp_found = false;
boolean tmp_found2 = false;
int lottery_id = 0;
int nineHole = 0;
int eighteenHole = 0;
int friends = 0;
int groups = 0;
int max_players = 0;
int sum_players = 0;
int req_time = 0;
int tmp_groups = 1;
int dts_slot_index = 0; // slot index number
int request_color = 0;
String fullName = "";
String cw = "";
String notes = "";
String in_use_by = "";
String time_color = "";
String dts_defaultF3Color = "#FFFFFF"; // default
while (rs.next()) {
tmp_found = true;
sum_players = 0;
nineHole = 0;
eighteenHole = 0;
in_use_by = "";
lottery_id = rs.getInt("id");
courseName = rs.getString("courseName");
req_time = rs.getInt("time");
notes = rs.getString("notes");
groups = rs.getInt("groups");
in_use = rs.getInt("in_use");
max_players = ((rs.getInt("fives") == 0 || rs.getString("p5").equalsIgnoreCase("No")) ? 4 : 5);
if (in_use == 1) in_use_by = rs.getString("in_use_by");
j++; // increment the jump label index (where to jump on page)
if (course.equals( "-ALL-" )) { // only display this col if multi course club
for (tmp_i = 0; tmp_i < courseCount; tmp_i++) {
if (courseName.equals(courseA[tmp_i])) break;
}
}
/*
if (groups == 1) {
buildRow(dts_slot_index, 1, course, course_color[tmp_i], bgcolor, max_players, courseCount, lcol_start, lcol_width, index, emailOpt, j, course_color[request_color + 13], false, hideUnavail, lott_name, rs, out);
dts_slot_index++;
request_color++;
} else {
*/
tmp_groups = 1; // reset
while (tmp_groups <= groups) {
buildRow(dts_slot_index, tmp_groups, course, course_color[tmp_i], bgcolor, max_players, courseCount, lcol_start, lcol_width, index, emailOpt, j, course_color[request_color + 13], (tmp_groups > 1), hideUnavail, lott_name, rs, out);
tmp_groups++;
dts_slot_index++;
} // end while
request_color++;
//} // end if multiple groups
} // end rs loop of lottery requests
out.println("<!-- total_lottery_slots=" + dts_slot_index + " -->");
out.println("</div>"); // end container
out.println("\n<!-- END OF LOTTERY REQ SHEET BODY -->");
out.println("<p> </p>");
int total_lottery_slots = dts_slot_index;
dts_slot_index = 0;
in_use = 0;
//
// End display notifications
//
out.println("<div id=tblLegend style=\"position:absolute\"><p align=center><font size=\"2\">");
out.println("<b>" + ((index < 0) ? "Old " : "") + "Tee Sheet Legend</b>");
out.println("</font><br><font size=\"1\">");
out.println("<b>F/B:</b> F = Front Nine, B = Back Nine, ");
out.println("O = Open (for cross-overs), S = Shotgun Event");
out.println("</font></p></div>");
//****************************************************************************
//
// start html for tee sheet
//
//****************************************************************************
//
// To change the position of the tee sheet (static position from top):
//
// Edit file 'dts-styles.css'
// "top" property for elHContainer (header for the main container)
// "top" property for elContainer (main container that holds the tee sheet elements)
// Increment both numbers equally!!!!!!!!!!!!
//
//****************************************************************************
String tmpCW = "C/W";
out.println("<br>");
out.println("\n<!-- START OF TEE SHEET HEADER -->");
out.println(""); // width=" + total_col_width + " align=center
out.println("<div id=\"elHContainer\">");
out.println("<span class=header style=\"left: " +col_start[1]+ "px; width: " +col_width[1]+ "px\">+/-</span><span");
out.println(" class=header style=\"left: " +col_start[2]+ "px; width: " +col_width[2]+ "px\">Time</span><span");
if (course.equals( "-ALL-" )) {
out.println(" class=header style=\"left: " +col_start[3]+ "px; width: " +col_width[3]+ "px\">Course</span><span ");
}
out.println(" class=header style=\"left: " +col_start[4]+ "px; width: " +col_width[4]+ "px\">F/B</span><span ");
out.println(" class=header style=\"left: " +col_start[5]+ "px; width: " +col_width[5]+ "px\">Player 1</span><span ");
out.println(" class=header style=\"left: " +col_start[6]+ "px; width: " +col_width[6]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[7]+ "px; width: " +col_width[7]+ "px\">Player 2</span><span ");
out.println(" class=header style=\"left: " +col_start[8]+ "px; width: " +col_width[8]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[9]+ "px; width: " +col_width[9]+ "px\">Player 3</span><span ");
out.println(" class=header style=\"left: " +col_start[10]+ "px; width: " +col_width[10]+ "px\">" +tmpCW+ "</span><span ");
out.println(" class=header style=\"left: " +col_start[11]+ "px; width: " +col_width[11]+ "px\">Player 4</span><span ");
out.print(" class=header style=\"left: " +col_start[12]+ "px; width: " +col_width[12]+ "px\"");
if (fivesALL == 0)
{
out.print(" id=widthMarker>" +tmpCW+"</span>");
} else {
out.print(">" +tmpCW+ "</span><span \n class=header style=\"left: " +col_start[13]+ "px; width: " +col_width[13]+ "px\">Player 5</span><span ");
out.print(" \n class=header style=\"left: " +col_start[14]+ "px; width: " +col_width[14]+ "px\" id=widthMarker>" +tmpCW+ "</span>");
}
out.print("</div>\n");
out.println("<!-- END OF TEE SHEET HEADER -->\n");
String first = "yes";
errMsg = "Get tee times.";
//
// Get the tee sheet for this date
//
String stringTee = "";
stringTee = "SELECT * " +
"FROM teecurr2 " +
"WHERE date = ? " +
((course.equals( "-ALL-" )) ? "" : "AND courseName = ? ") +
((hideUnavail.equals("1")) ? "AND time >= ? AND time <= ? " : "") +
"ORDER BY time, courseName, fb";
out.println("<!-- index=" + index + " -->");
out.println("<!-- date=" + date + " -->");
out.println("<!-- lott_start_time=" + lott_start_time + " -->");
out.println("<!-- lott_end_time=" + lott_end_time + " -->");
out.println("<!-- course=" + course + " -->");
out.println("<!-- stringTee=" + stringTee + " -->");
pstmt = con.prepareStatement (stringTee);
int parm_index = 2;
int teepast_id = 0;
pstmt.clearParameters();
pstmt.setLong(1, date);
if (!course.equals( "-ALL-" )) {
pstmt.setString(2, course);
parm_index = 3;
}
if (hideUnavail.equals("1")) {
pstmt.setInt(parm_index, lott_start_time);
parm_index++;
pstmt.setInt(parm_index, lott_end_time);
}
rs = pstmt.executeQuery();
out.println("\n<!-- START OF TEE SHEET BODY -->");
out.println("<div id=\"elContainer\">\n");
// loop thru each of the tee times
while (rs.next()) {
player1 = rs.getString("player1");
player2 = rs.getString("player2");
player3 = rs.getString("player3");
player4 = rs.getString("player4");
player5 = rs.getString("player5");
p1cw = rs.getString("p1cw");
p2cw = rs.getString("p2cw");
p3cw = rs.getString("p3cw");
p4cw = rs.getString("p4cw");
p5cw = rs.getString("p5cw");
p91 = rs.getInt("p91");
p92 = rs.getInt("p92");
p93 = rs.getInt("p93");
p94 = rs.getInt("p94");
p95 = rs.getInt("p95");
time = rs.getInt("time");
fb = rs.getShort("fb");
courseT = rs.getString("courseName");
teecurr_id = rs.getInt("teecurr_id");
hr = rs.getInt("hr");
min = rs.getInt("min");
event = rs.getString("event");
ecolor = rs.getString("event_color");
rest = rs.getString("restriction");
rcolor = rs.getString("rest_color");
conf = rs.getString("conf");
in_use = rs.getInt("in_use");
type = rs.getInt("event_type");
hole = rs.getString("hole");
blocker = rs.getString("blocker");
rest5 = rs.getString("rest5");
bgcolor5 = rs.getString("rest5_color");
lottery = rs.getString("lottery");
lottery_color = rs.getString("lottery_color");
//
// If course=ALL requested, then set 'fives' option according to this course
//
if (course.equals( "-ALL-" )) {
i = 0;
loopall:
while (i < 20) {
if (courseT.equals( courseA[i] )) {
fives = fivesA[i]; // get the 5-some option for this course
break loopall; // exit loop
}
i++;
}
}
boolean blnHide = false;
// REMOVED HIDING OF FULL TEE TIMES
/*
if (hideUnavail.equals("1")) {
if (fives == 0 || !rest5.equals("") ) {
if ( !player1.equals("") && !player2.equals("") && !player3.equals("") && !player4.equals("") ) blnHide = true;
} else {
if ( !player1.equals("") && !player2.equals("") && !player3.equals("") && !player4.equals("") && !player5.equals("")) blnHide = true;
}
}
*/
// only show this slot if it is NOT blocked
// and hide it if fives are disallowed and player1-4 full (all slots full already excluded in sql)
if ( blocker.equals( "" ) && blnHide == false) { // continue if tee time not blocked - else skip
ampm = " AM";
if (hr == 12) {
ampm = " PM";
}
if (hr > 12) {
ampm = " PM";
hr = hr - 12; // convert to conventional time
}
bgcolor = "#FFFFFF"; //default
if (!event.equals("")) {
bgcolor = ecolor;
} else {
if (!rest.equals("")) {
bgcolor = rcolor;
} else {
if (!lottery_color.equals("")) {
bgcolor = lottery_color;
}
}
}
if (bgcolor.equals("Default")) {
bgcolor = "#FFFFFF"; //default
}
if (bgcolor5.equals("")) {
bgcolor5 = bgcolor; // player5 bgcolor = others if 5-somes not restricted
}
if (p91 == 1) { // if 9 hole round
p1cw = p1cw + "9";
}
if (p92 == 1) {
p2cw = p2cw + "9";
}
if (p93 == 1) {
p3cw = p3cw + "9";
}
if (p94 == 1) {
p4cw = p4cw + "9";
}
if (p95 == 1) {
p5cw = p5cw + "9";
}
if (player1.equals("")) {
p1cw = "";
}
if (player2.equals("")) {
p2cw = "";
}
if (player3.equals("")) {
p3cw = "";
}
if (player4.equals("")) {
p4cw = "";
}
if (player5.equals("")) {
p5cw = "";
}
g1 = 0; // init guest indicators
g2 = 0;
g3 = 0;
g4 = 0;
g5 = 0;
//
// Check if any player names are guest names
//
if (!player1.equals( "" )) {
i = 0;
ploop1:
while (i < parm.MAX_Guests) {
if (player1.startsWith( parm.guest[i] )) {
g1 = 1; // indicate player1 is a guest name
break ploop1;
}
i++;
}
}
if (!player2.equals( "" )) {
i = 0;
ploop2:
while (i < parm.MAX_Guests) {
if (player2.startsWith( parm.guest[i] )) {
g2 = 1; // indicate player2 is a guest name
break ploop2;
}
i++;
}
}
if (!player3.equals( "" )) {
i = 0;
ploop3:
while (i < parm.MAX_Guests) {
if (player3.startsWith( parm.guest[i] )) {
g3 = 1; // indicate player3 is a guest name
break ploop3;
}
i++;
}
}
if (!player4.equals( "" )) {
i = 0;
ploop4:
while (i < parm.MAX_Guests) {
if (player4.startsWith( parm.guest[i] )) {
g4 = 1; // indicate player4 is a guest name
break ploop4;
}
i++;
}
}
if (!player5.equals( "" )) {
i = 0;
ploop5:
while (i < parm.MAX_Guests) {
if (player5.startsWith( parm.guest[i] )) {
g5 = 1; // indicate player5 is a guest name
break ploop5;
}
i++;
}
}
//
// Process the F/B parm 0 = Front 9, 1 = Back 9, 9 = none (open for cross-over)
//
sfb = "F"; // default Front 9
if (fb == 1) {
sfb = "B";
}
if (fb == 9) {
sfb = "O";
}
if (type == shotgun) {
sfb = (!hole.equals("")) ? hole : "S"; // there's an event and its type is 'shotgun'
}
// set default color for first three columns
if (in_use != 0) dts_defaultF3Color = "";
//
//**********************************
// Build the tee time rows
//**********************************
//
if (min < 10) {
dts_tmp = hr + ":0" + min + ampm;
} else {
dts_tmp = hr + ":" + min + ampm;
}
out.print("<div id=time_slot_"+ dts_slot_index +" time=\"" + time + "\" course=\"" + courseT + "\" startX=0 startY=0 tid="+((teecurr_id == 0) ? teepast_id : teecurr_id)+" ");
if (in_use == 0 && index >= 0) {
// not in use
out.println("class=timeSlot drag=true style=\"background-color: "+ bgcolor +"\" bgc=\""+ bgcolor +"\">");
} else {
// in use
out.println("class=timeSlotInUse>");
}
// col for 'insert' and 'delete' requests
out.print(" <span id=time_slot_" + dts_slot_index + "_A class=cellDataB style=\"cursor: default; left: " + col_start[1] + "px; width: " + col_width[1] + "px; background-color: #FFFFFF\">");
j++; // increment the jump label index (where to jump on page)
out.print("<a name=\"jump" + j + "\"></a>"); // create a jump label for returns
if (in_use == 0 && index >= 0) {
// not in use
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseT+ "&returnCourse=" +course+ "&time=" +time+ "&fb=" +fb+ "&jump=" +j+ "&email=" +emailOpt+ "&first=" +first+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&insert=yes\" title=\"Insert a time slot\" alt=\"Insert a time slot\">");
out.print("<img src=/" +rev+ "/images/dts_newrow.gif width=13 height=13 border=0></a>");
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +courseT+ "&returnCourse=" +course+ "&time=" +time+ "&fb=" +fb+ "&jump=" +j+ "&email=" +emailOpt+ "&lott_name=" + lott_name + "&hide=" + hideUnavail + "&delete=yes\" title=\"Delete time slot\" alt=\"Remove time slot\">");
out.print("<img src=/" +rev+ "/images/dts_trash.gif width=13 height=13 border=0></a>");
} else {
// in use
out.print("<img src=/" +rev+ "/images/busy.gif width=32 height=13 border=0 alt=\"Busy\" title=\"Busy\">");
}
out.println("</span>");
// time column
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_time class=cellData hollow=true style=\"left: " + col_start[2] + "px; width: " + col_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_time class=cellData style=\"cursor: default; left: " + col_start[2] + "px; width: " + col_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
}
if (min < 10) {
out.print(hr + ":0" + min + ampm);
} else {
out.print(hr + ":" + min + ampm);
}
out.println("</span>");
//
// Name of Course
//
if (course.equals( "-ALL-" )) { // only display this col if this tee sheet is showing more than one course
for (tmp_i = 0; tmp_i < courseCount; tmp_i++) {
if (courseT.equals(courseA[tmp_i])) break;
}
out.print(" <span id=time_slot_" + dts_slot_index + "_course class=cellDataC style=\"cursor: default; left: " + col_start[3] + "px; width: " + col_width[3] + "px; background-color:" + course_color[tmp_i] + "\">");
if (!courseT.equals("")) { out.print(fitName(courseT)); }
out.println("</span>");
}
//
// Front/Back Indicator (note: do we want to display the FBO popup if it's a shotgun event)
//
if (in_use == 0 && hole.equals("") && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_FB class=cellData onclick=\"showFBO(this)\" value=\""+sfb+"\" style=\"cursor: hand; left: " + col_start[4] + "px; width: " + col_width[4] + "px\">"); // background-color: " +dts_defaultF3Color+ "
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_FB class=cellDataB value=\""+sfb+"\" style=\"cursor: default; left: " + col_start[4] + "px; width: " + col_width[4] + "px\">");
}
out.print(sfb);
out.println("</span>");
//
// Add Player 1
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1 class=cellData drag=true startX="+col_start[5]+" playerSlot=1 style=\"left: " + col_start[5] + "px; width: " + col_width[5] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1 class=cellData startX="+col_start[5]+" playerSlot=1 style=\"cursor: default; left: " + col_start[5] + "px; width: " + col_width[5] + "px\">");
}
if (!player1.equals("")) { out.print(fitName(player1)); }
out.println("</span>");
// Player 1 CW
if ((!player1.equals("")) && (!player1.equalsIgnoreCase( "x" ))) {
dts_tmp = p1cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[6] + "px; width: " + col_width[6] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_1_CW class=cellDataB style=\"cursor: default; left: " + col_start[6] + "px; width: " + col_width[6] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 2
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2 class=cellData drag=true startX="+col_start[7]+" playerSlot=2 style=\"left: " + col_start[7] + "px; width: " + col_width[7] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2 class=cellData startX="+col_start[7]+" playerSlot=2 style=\"cursor: default; left: " + col_start[7] + "px; width: " + col_width[7] + "px\">");
}
if (!player2.equals("")) { out.print(fitName(player2)); }
out.println(" </span>");
// Player 2 CW
if ((!player2.equals("")) && (!player2.equalsIgnoreCase( "x" ))) {
dts_tmp = p2cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[8] + "px; width: " + col_width[8] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_2_CW class=cellDataB style=\"cursor: default; left: " + col_start[8] + "px; width: " + col_width[8] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 3
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3 class=cellData drag=true startX="+col_start[9]+" playerSlot=3 style=\"left: " + col_start[9] + "px; width: " + col_width[9] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3 class=cellData startX="+col_start[9]+" playerSlot=3 style=\"cursor: default; left: " + col_start[9] + "px; width: " + col_width[9] + "px\">");
}
if (!player3.equals("")) { out.print(fitName(player3)); }
out.println("</span>");
// Player 3 CW
if ((!player3.equals("")) && (!player3.equalsIgnoreCase( "x" ))) {
dts_tmp = p3cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[10] + "px; width: " + col_width[10] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_3_CW class=cellDataB style=\"cursor: default; left: " + col_start[10] + "px; width: " + col_width[10] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 4
//
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4 class=cellData drag=true startX="+col_start[11]+" playerSlot=4 style=\"left: " + col_start[11] + "px; width: " + col_width[11] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4 class=cellData startX="+col_start[11]+" playerSlot=4 style=\"cursor: default; left: " + col_start[11] + "px; width: " + col_width[11] + "px\">");
}
if (!player4.equals("")) { out.print(fitName(player4)); }
out.println("</span>");
// Player 4 CW
if ((!player4.equals("")) && (!player4.equalsIgnoreCase( "x" ))) {
dts_tmp = p4cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[12] + "px; width: " + col_width[12] + "px\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_4_CW class=cellDataB style=\"cursor: default; left: " + col_start[12] + "px; width: " + col_width[12] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
//
// Add Player 5 if supported
//
if (fivesALL != 0) { // if 5-somes on any course (Paul - this is a new flag!!!!)
if (fives != 0) { // if 5-somes on this course
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData drag=true startX="+col_start[13]+" playerSlot=5 style=\"left: " + col_start[13] + "px; width: " + col_width[13] + "px; background-color: " +bgcolor5+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData startX="+col_start[13]+" playerSlot=5 style=\"cursor: default; left: " + col_start[13] + "px; width: " + col_width[13] + "px\">");
}
if (!player5.equals("")) { out.print(fitName(player5)); }
out.println("</span>");
// Player 5 CW
if ((!player5.equals("")) && (!player5.equalsIgnoreCase( "x" ))) {
dts_tmp = p5cw;
} else {
dts_tmp = "";
}
if (in_use == 0 && index >= 0) {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB onclick=\"showTOPopup(this)\" value=\"" + dts_tmp + "\" style=\"left: " + col_start[14] + "px; width: " + col_width[14] + "px; background-color: " +bgcolor5+ "\">");
} else {
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB style=\"cursor: default; left: " + col_start[14] + "px; width: " + col_width[14] + "px\">");
}
out.print(dts_tmp);
out.println("</span>");
} else { // 5-somes on at least 1 course, but not this one
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5 class=cellData startX="+col_start[13]+" playerSlot=5 style=\"cursor: default; left: " + col_start[13] + "px; width: " + col_width[13] + "px; background-image: url('/v5/images/shade1.gif')\">");
out.println("</span>");
// Player 5 CW
dts_tmp = "";
out.print(" <span id=time_slot_" + dts_slot_index + "_player_5_CW class=cellDataB style=\"cursor: default; left: " + col_start[14] + "px; width: " + col_width[14] + "px; background-image: url('/v5/images/shade1.gif')\">");
out.print(dts_tmp);
out.println("</span>");
} // end if fives
} // end if fivesALL
out.println("</div>"); // end timeslot container div
dts_slot_index++; // increment timeslot index counter
first = "no"; // no longer first time displayed
} // end of IF Blocker that escapes building and displaying a particular tee time slot in the sheet
} // end of while
out.println("<br>"); // spacer at bottom of tee sheet
out.println("\n</div>"); // end main container div holding entire tee sheet
out.println("<!-- END OF TEE SHEET BODY -->\n");
out.println("<br><br>\n");
pstmt.close();
// write out form for posting tee sheet actions to the server for processing
out.println("<form name=frmSendAction method=POST action=/" +rev+ "/servlet/Proshop_dlott>");
out.println("<input type=hidden name=convert value=\"\">");
out.println("<input type=hidden name=index value=\"" + index + "\">");
out.println("<input type=hidden name=returnCourse value=\"" + course + "\">");
out.println("<input type=hidden name=email value=\"" + emailOpt + "\">");
out.println("<input type=hidden name=hide value=\"" + hideUnavail + "\">");
out.println("<input type=hidden name=lott_name value=\"" + lott_name + "\">");
out.println("<input type=hidden name=lotteryId value=\"\">");
out.println("<input type=hidden name=group value=\"\">");
out.println("<input type=hidden name=from_tid value=\"\">");
out.println("<input type=hidden name=to_tid value=\"\">");
out.println("<input type=hidden name=from_course value=\"\">");
out.println("<input type=hidden name=to_course value=\"\">");
out.println("<input type=hidden name=jump value=\"\">"); // needs to be set in ....js !!!!!
out.println("<input type=hidden name=from_time value=\"\">");
out.println("<input type=hidden name=from_fb value=\"\">");
out.println("<input type=hidden name=to_time value=\"\">");
out.println("<input type=hidden name=to_fb value=\"\">");
out.println("<input type=hidden name=from_player value=\"\">");
out.println("<input type=hidden name=to_player value=\"\">");
out.println("<input type=hidden name=to_from value=\"\">");
out.println("<input type=hidden name=to_to value=\"\">");
out.println("<input type=hidden name=changeAll value=\"\">");
out.println("<input type=hidden name=ninehole value=\"\">");
out.println("</form>");
// START OF FBO POPUP WINDOW //
out.println("<div id=elFBOPopup defaultValue=\"\" style=\"visibility: hidden\" jump=\"\">");
out.println("<table width=100% height=100% border=0 cellpadding=0 cellspacing=2>");
out.println("<form name=frmFBO>");
out.println("<input type=hidden name=jump value=\"\">");
out.println("<tr><td align=center class=smtext><b><u>Make Selection</u></b></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=F name=FBO id=FBO_1><label for=\"FBO_1\">Front</label></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=B name=FBO id=FBO_2><label for=\"FBO_2\">Back</label></td></tr>");
out.println("<tr><td class=smtext><input type=radio value=O name=FBO id=FBO_3><label for=\"FBO_3\">Crossover</label></td></tr>");
out.println("<tr><td align=right><a href=\"javascript: cancelFBOPopup()\" class=smtext>cancel</a> <a href=\"javascript: saveFBOPopup()\" class=smtext>save</a> </td></tr>");
out.println("</form>");
out.println("</table>");
out.println("</div>");
// START OF TRANSPORTATION POPUP WINDOW //
//
// Note: There can now be up to 16 dynamic Modes of Transportation (proshop can config).
// Both the Full Name/Description and the Acronym are specified by the pro.
// These names and acronyms will not contain the '9' to indicate 9 holes.
// These values can be found in:
//
// parmc.tmode[i] = full name description
// parmc.tmodea[i] = 1 to 3 character acronym (i = index of 0 - 15)
//
//
out.println("<div id=elTOPopup defaultValue=\"\" fb=\"\" nh=\"\" jump=\"\">");
out.println("<table width=100% height=100% border=0 cellpadding=0 cellspacing=2>");
out.println("<form name=frmTransOpt>");
out.println("<input type=hidden name=jump value=\"\">");
// loop thru the array and write out a table row for each option
// set tmp_cols to the # of cols this table will have
// if the # of trans opts is less then 4 then that's the #, otherwise the max is 4
// tmode_limit = max number of tmodes available
// tmode_count = actual number of tmodes specified for this course
int tmp_cols = 0;
if (parmc.tmode_count < 4) {
tmp_cols = parmc.tmode_count;
} else {
tmp_cols = 4;
}
int tmp_count = 0;
out.println("<tr><td align=center class=smtext colspan="+tmp_cols+"><b><u>Make Selection</u></b></td></tr>");
out.println("<tr>");
for (int tmp_loop = 0; tmp_loop < parmc.tmode_limit; tmp_loop++) {
if (!parmc.tmodea[tmp_loop].equals( "" ) && !parmc.tmodea[tmp_loop].equals( null )) {
out.println("<td nowrap class=smtext><input type=radio value="+parmc.tmodea[tmp_loop]+" name=to id=to_"+tmp_loop+"><label for=\"to_"+tmp_loop+"\">"+parmc.tmode[tmp_loop]+"</label></td>");
if (tmp_count == 3 || tmp_count == 7 || tmp_count == 11) {
out.println("</tr><tr>"); // new row
}
tmp_count++;
}
}
out.println("</tr>");
out.println("<tr><td bgcolor=black colspan="+tmp_cols+"><img src=/" +rev+ "/images/shim.gif width=100 height=1 border=0></td></tr>");
out.println("<tr><td class=smtext colspan="+tmp_cols+"><input type=checkbox value=yes name=9hole id=nh><label for=\"nh\">9 Hole</label></td></tr>");
out.println("<tr><td bgcolor=black colspan="+tmp_cols+"><img src=/" +rev+ "/images/shim.gif width=100 height=1 border=0></td></tr>");
// "CHANGE ALL" DEFAULT OPTION COULD BE SET HERE
out.println("<tr><td class=smtext colspan="+tmp_cols+"><input type=checkbox value=yes name=changeAll id=ca><label for=\"ca\">Change All</label></td></tr>");
out.println("<tr><td align=right colspan="+tmp_cols+"><a href=\"javascript: cancelTOPopup()\" class=smtext>cancel</a> <a href=\"javascript: saveTOPopup()\" class=smtext>save</a> </td></tr>");
out.println("</form>");
out.println("</table>");
out.println("</div>");
// FINAL JAVASCRIPT FOR THE PAGE, SET VARIABLES THAT WE DIDN'T KNOW TILL AFTER PROCESSING
out.println("<script type=\"text/javascript\">");
//out.println("/*if (document.getElementById(\"time_slot_0\")) {");
//out.println(" slotHeight = document.getElementById(\"time_slot_0\").offsetHeight;");
//out.println("} else if (document.getElementById(\"time_slot_0\")) {");
//out.println(" slotHeight = document.getElementById(\"lottery_slot_0\").offsetHeight;");
//out.println("}*/");
out.println("var slotHeight = 20;");
out.println("var g_markerY = document.getElementById(\"imgMarker\").offsetTop;");
out.println("var g_markerX = document.getElementById(\"imgMarker\").offsetLeft;");
out.println("var totalTimeSlots = " + (dts_slot_index) + ";");
out.println("var totalLotterySlots = " + (total_lottery_slots) + ";");
out.println("var g_transOptTotal = " + tmp_count + ";");
out.println("var g_pslot1s = " + col_start[5] + ";");
out.println("var g_pslot1e = " + col_start[6] + ";");
out.println("var g_pslot2s = " + col_start[7] + ";");
out.println("var g_pslot2e = " + col_start[8] + ";");
out.println("var g_pslot3s = " + col_start[9] + ";");
out.println("var g_pslot3e = " + col_start[10] + ";");
out.println("var g_pslot4s = " + col_start[11] + ";");
out.println("var g_pslot4e = " + col_start[12] + ";");
out.println("var g_pslot5s = " + col_start[13] + ";");
out.println("var g_pslot5e = " + col_start[14] + ";");
// SIZE UP THE CONTAINER ELEMENTS AND THE TIME SLOTS
out.println("var e = document.getElementById('widthMarker');");
out.println("var g_slotWidth = e.offsetLeft + e.offsetWidth;");
out.println("var e2 = document.getElementById('widthMarker2');");
out.println("var g_lotterySlotWidth = e2.offsetLeft + e2.offsetWidth;");
out.println("document.styleSheets[0].rules(0).style.width = (g_slotWidth + 2) + 'px';"); // elHContainer
out.println("document.styleSheets[0].rules(1).style.width = (g_slotWidth + 2) + 'px';"); // elContainer
out.println("document.styleSheets[0].rules(7).style.width = g_slotWidth + 'px';"); // header
out.println("document.styleSheets[0].rules(8).style.width = g_slotWidth + 'px';"); // timeslot
out.println("document.styleSheets[0].rules(10).style.width = g_lotterySlotWidth + 'px';"); // lotterySlot
out.println("document.styleSheets[0].rules(12).style.width = (g_lotterySlotWidth + 2) + 'px';"); // elHContainer2
out.println("document.styleSheets[0].rules(13).style.width = (g_lotterySlotWidth + 2) + 'px';"); // elContainer2
int tmp_offset1 = (total_lottery_slots == 0) ? 0 : (total_lottery_slots * 20) + 2; // height of lottery container
int tmp_offset2 = (dts_slot_index == 0) ? 0 : (dts_slot_index * 20) + 2; // height of tee sheet container
int tmp_offset3 = (total_lottery_slots == 0) ? 0 : 24; // 24 is height of header
int tmp_offset4 = 24; // 24 is height of header
int tmp_offset5 = (total_lottery_slots == 0) ? 40 : 80;
// REPOSITION THE CONTAINERS TO THE MARKER
out.println("document.getElementById(\"elHContainer2\").style.top=g_markerY;");
out.println("document.getElementById(\"elHContainer2\").style.left=g_markerX;");
out.println("document.getElementById(\"elContainer2\").style.top=g_markerY+22;");
out.println("document.getElementById(\"elContainer2\").style.left=g_markerX;");
if (total_lottery_slots == 0) {
out.println("document.getElementById(\"elContainer2\").style.visibility = \"hidden\";");
out.println("document.getElementById(\"elHContainer2\").style.visibility = \"hidden\";");
out.println("document.getElementById(\"elContainer2\").style.height = \"0px\";");
out.println("document.getElementById(\"elHContainer2\").style.height = \"0px\";");
} else {
// CALL THE POSITIONING CODE FOR EACH OF LOTTERY SLOTS WE CREATED
out.println("for(x=0;x<=totalLotterySlots-1;x++) eval(\"positionElem('lottery_slot_\" + x + \"', \"+ x +\")\");");
out.println("document.getElementById(\"elContainer2\").style.height=\"" + tmp_offset1 + "px\";");
}
// POSITION THE LEGENDS
out.println("document.getElementById(\"tblLegend\").style.top=g_markerY + " + (tmp_offset1 + (tmp_offset3 * 2)) + ";");
out.println("document.getElementById(\"tblLegend\").style.width=g_slotWidth;");
//out.println("document.getElementById(\"tblLottLegend\").style.top=g_markerY;");
//out.println("document.getElementById(\"tblLottLegend\").style.width=g_slotWidth;");
// POSITION THE TEE SHEET CONTAINER
out.println("document.getElementById(\"elContainer\").style.top=(g_markerY + " + (tmp_offset1 + tmp_offset4 + tmp_offset5) + ");");
out.println("document.getElementById(\"elHContainer\").style.top=(g_markerY + " + (tmp_offset1 + tmp_offset5) + ");");
if (dts_slot_index == 0) {
out.println("document.getElementById(\"elContainer\").style.visibility = \"hidden\";");
} else {
// CALL THE POSITIONING CODE FOR EACH OF THE TIME SLOTS WE CREATED
out.println("for(x=0;x<=totalTimeSlots-1;x++) eval(\"positionElem('time_slot_\" + x + \"', \"+ x +\")\");");
out.println("document.getElementById(\"elContainer\").style.height=\"" + tmp_offset2 + "px\";");
}
out.println("</script>");
out.println("<script type=\"text/javascript\">");
out.println("function checkCourse() {");
out.println(" var f = document.getElementById(\"frmSendAction\").returnCourse;");
out.println(" if (f.value == \"-ALL-\") {");
out.println(" alert(\"You must select a specific course before going back.\\nYou are currently viewing ALL courses for this day.\");");
out.println(" return false;");
out.println(" }");
out.println(" return true;");
out.println("}");
out.println("function convert(lottid) {");
out.println(" f = document.getElementById('frmSendAction');");
out.println(" f.lotteryId.value = lottid;");
out.println(" f.convert.value = 'auto';");
out.println(" f.submit();");
//out.println(" alert(f.action);");
out.println("}");
out.println("</script>");
// END OF OUT FINAL CLIENT SIDE SCRIPT WRITING
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H1>Database Access Error</H1>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>Error = " +errMsg);
out.println("<BR><BR>Exception = " + e1.getMessage());
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// End of HTML page
//
out.println("<p> </p>");
out.println("</body>\n</html>");
out.close();
} // end of doGet
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
HttpSession session = SystemUtils.verifyPro(req, out); // check for intruder
if (session == null) return;
Connection con = SystemUtils.getCon(session); // get DB connection
if (con == null) {
out.println(SystemUtils.HeadTitle("DB Connection Error"));
out.println("<BODY><CENTER><BR>");
out.println("<BR><BR><H3>Database Connection Error</H3>");
out.println("<BR><BR>Unable to connect to the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// Handle the conversion of notifications to teecurr2 entries
//
if (req.getParameter("convert") != null) {
if (req.getParameter("convert").equals("yes")) {
convert(req, out, con, session, resp);
return;
} else if (req.getParameter("convert").equals("auto")) {
auto_convert(req, out, con, session, resp);
return;
} else if (req.getParameter("convert").equals("all")) {
convert_all(req, out, con, session, resp);
return;
}
}
//
// parm block to hold the tee time parms
//
parmSlot slotParms = new parmSlot(); // allocate a parm block
String changeAll = "";
String ninehole = "";
String dts_tmp = "";
String prompt = "";
int skip = 0;
long date = 0;
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// Get this session's username (to be saved in teecurr)
//
slotParms.user = (String)session.getAttribute("user");
slotParms.club = (String)session.getAttribute("club");
try {
//
// Get the parms passed
//
slotParms.jump = req.getParameter("jump"); // anchor link for page loading
String indexs = req.getParameter("index"); // # of days ahead of current day
slotParms.ind = Integer.parseInt(indexs); // save index value in parm block
String lott_name = req.getParameter("lott_name"); // lottery name
slotParms.lottery = lott_name;
//
// Get the optional parms
//
if (req.getParameter("email") != null) {
slotParms.sendEmail = req.getParameter("email");
} else {
slotParms.sendEmail = "yes";
}
if (req.getParameter("returnCourse") != null) {
slotParms.returnCourse = req.getParameter("returnCourse");
} else {
slotParms.returnCourse = "";
}
if (req.getParameter("from_course") != null) {
slotParms.from_course = req.getParameter("from_course");
} else {
slotParms.from_course = "";
}
if (req.getParameter("to_course") != null) {
slotParms.to_course = req.getParameter("to_course");
} else {
slotParms.to_course = "";
}
if (req.getParameter("from_player") != null) {
dts_tmp = req.getParameter("from_player");
if (!dts_tmp.equals( "" )) {
slotParms.from_player = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_player") != null) {
dts_tmp = req.getParameter("to_player");
if (!dts_tmp.equals( "" )) {
slotParms.to_player = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("from_time") != null) {
dts_tmp = req.getParameter("from_time");
if (!dts_tmp.equals( "" )) {
slotParms.from_time = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_time") != null) {
dts_tmp = req.getParameter("to_time");
if (!dts_tmp.equals( "" )) {
slotParms.to_time = Integer.parseInt(dts_tmp);
}
}
if (req.getParameter("to_from") != null) {
slotParms.to_from = req.getParameter("to_from");
}
if (req.getParameter("to_to") != null) {
slotParms.to_to = req.getParameter("to_to");
}
if (req.getParameter("changeAll") != null) {
changeAll = req.getParameter("changeAll");
}
if (req.getParameter("ninehole") != null) {
ninehole = req.getParameter("ninehole");
}
if (req.getParameter("prompt") != null) { // if 2nd entry (return from prompt)
prompt = req.getParameter("prompt");
dts_tmp = req.getParameter("date");
if (!dts_tmp.equals( "" )) {
date = Integer.parseInt(dts_tmp);
}
dts_tmp = req.getParameter("to_fb");
if (!dts_tmp.equals( "" )) {
slotParms.to_fb = Integer.parseInt(dts_tmp);
}
dts_tmp = req.getParameter("from_fb");
if (!dts_tmp.equals( "" )) {
slotParms.from_fb = Integer.parseInt(dts_tmp);
}
if (req.getParameter("skip") != null) { // if 2nd entry and skip returned
dts_tmp = req.getParameter("skip");
if (!dts_tmp.equals( "" )) {
skip = Integer.parseInt(dts_tmp);
}
}
} else {
if (req.getParameter("from_fb") != null) {
dts_tmp = req.getParameter("from_fb");
// ***************TEMP************
// System.out.println("from_fb = " +dts_tmp);
// ***************TEMP************
slotParms.from_fb = 0;
if (dts_tmp.equals( "B" )) {
slotParms.from_fb = 1;
}
if (dts_tmp.equals( "O" )) {
slotParms.from_fb = 9;
}
}
if (req.getParameter("to_fb") != null) {
dts_tmp = req.getParameter("to_fb");
// ***************TEMP************
// System.out.println("to_fb = " +dts_tmp);
// ***************TEMP************
slotParms.to_fb = 0;
if (dts_tmp.equals( "B" )) {
slotParms.to_fb = 1;
}
if (dts_tmp.equals( "O" )) {
slotParms.to_fb = 9;
}
}
}
} catch (Exception e) {
out.println("Error parsing input variables. " + e.toString());
}
if (date == 0) {
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
if (slotParms.ind > 0) {
cal.add(Calendar.DATE,slotParms.ind); // roll ahead 'index' days
}
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
int day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
slotParms.dd = day;
slotParms.mm = month;
slotParms.yy = year;
slotParms.day = day_table[day_num]; // get name for day
date = (year * 10000) + (month * 100) + day; // create a date field of yyyymmdd
} else {
if (req.getParameter("day") != null) {
slotParms.day = req.getParameter("day");
}
long lyy = date / 10000; // get year
long lmm = (date - (lyy * 10000)) / 100; // get month
long ldd = (date - (lyy * 10000)) - (lmm * 100); // get day
slotParms.dd = (int)ldd;
slotParms.mm = (int)lmm;
slotParms.yy = (int)lyy;
}
//
// determine the type of call: Change F/B, Change C/W, Single Player Move, Whole Tee Time Move
//
if (!slotParms.to_from.equals( "" ) && !slotParms.to_to.equals( "" )) {
changeCW(slotParms, changeAll, ninehole, date, req, out, con, resp); // process Change C/W
return;
}
if (slotParms.to_time == 0) { // if not C/W and no 'to_time' specified
changeFB(slotParms, date, req, out, con, resp); // process Change F/B
return;
}
if ((slotParms.to_player == 0) && (slotParms.from_player == 0)) {
moveWhole(slotParms, date, prompt, skip, req, out, con, resp); // process Move Whole Tee Time
return;
}
if (slotParms.from_player > 0 && slotParms.to_player > 0) {
moveSingle(slotParms, date, prompt, skip, req, out, con, resp); // process Move Single Tee Time
return;
}
//
// If we get here, there is an error
//
out.println(SystemUtils.HeadTitle("Error in Proshop_dlott"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H2>Error While Editing Tee Sheet</H2>");
out.println("<BR><BR>An error has occurred that prevents the system from completing the task.<BR>");
out.println("<BR>Please try again. If problem continues, contact ForeTees.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +slotParms.ind+ "&course=" +slotParms.returnCourse+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
} // end of doPost
//
// returns the player name but enforces a max length for staying in the width allowed
// change the two positive values to control the output
//
private static String fitName(String pName) {
return (pName.length() > 14) ? pName.substring(0, 13) + "..." : pName;
}
private static String getTime(int time) {
try {
String ampm = "AM";
int hr = time / 100;
int min = time % (hr * 100);
if (hr == 12) {
ampm = "PM";
} else if (hr > 12) {
hr -= 12;
ampm = "PM";
}
return hr + ":" + SystemUtils.ensureDoubleDigit(min) + " " + ampm;
} catch (Exception ignore) {
return "N/A";
}
}
private void buildRow(int slotIndex, int group, String course, String course_color, String bgcolor, int max_players, int courseCount, int lcol_start[], int lcol_width[], int index, String emailOpt, int j, String dts_defaultF3Color, boolean child, String hideUnavail, String lott_name, ResultSet rs, PrintWriter out) {
// out.println("<!-- slotIndex=" + slotIndex + ", group=" + group + ", max_players=" + max_players + " -->");
try {
boolean tmp_found2 = false;
boolean moved = false;
String fullName = "";
String player_list = "";
int nineHole = 0;
int x2 = 0; // player data pos in rs
//int sum_players = 0;
for (int x = 0; x <= max_players - 1; x++) {
x2 = x + ((group - 1) * max_players); // position offset
fullName = rs.getString(x2 + 13);
if (fullName.equals("MOVED")) moved = true;
nineHole = rs.getInt(x2 + 137);
//cw = rs.getString(x2 + 63);
//eighteenHole = 1; //rs.getInt(x + );
if (!fullName.equals("")) {
if (tmp_found2) player_list = player_list + (", ");
player_list = player_list + fullName + ((nineHole == 1) ? "<font style=\"font-size:8px\"> (9)</font>" : "");
tmp_found2 = true;
//out.print(fullName + ((nineHole == 1) ? "<font style=\"font-size:8px\"> (9)</font>" : ""));
//sum_players++;
}
}
//
// Start Row
//
out.print("<div id=lottery_slot_"+ slotIndex +" time=\"" + rs.getInt("time") + "\" course=\"" + rs.getString("courseName") + "\" startX=0 startY=0 lotteryId=\"" + rs.getInt("id") + "\" group=\"" + group + "\" ");
if (rs.getInt("in_use") == 0 && !moved) {
// not in use
out.println("class=lotterySlot drag=true style=\"background-color: "+ bgcolor +"\" bgc=\""+ bgcolor +"\">");
} else {
// in use
out.println("class=timeSlotInUse>");
}
//
// Col for 'move' and 'delete' requests
//
out.print(" <span id=lottery_slot_" + slotIndex + "_A class=cellDataB style=\"cursor: default; left: " + lcol_start[1] + "px; width: " + lcol_width[1] + "px; background-color: #FFFFFF\">");
j++; // increment the jump label index (where to jump on page)
out.print("<a name=\"jump" + j + "\"></a>"); // create a jump label for returns
if (rs.getInt("in_use") == 0) {
// not in use
if (!child) {
//out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&lotteryId=" + rs.getInt("id") + "&returnCourse=" +course+ "&email=" +emailOpt+ "&convert=yes\" title=\"Move Request\" alt=\"Move Request\">");
if (rs.getInt("atime1") == 0) {
// unassigned (will need to be dragged to tee sheet)
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
} else {
// had an assigned time
out.print("<a href=\"javascript:convert('" + rs.getInt("id") + "')\" onclick=\"void(0)\" title=\"Move Request\" alt=\"Move Request\">");
out.print("<img src=/" +rev+ "/images/dts_move.gif width=13 height=13 border=0></a>");
}
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<a href=\"/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&lotteryId=" + rs.getInt("id") + "&returnCourse=" +course+ "&email=" +emailOpt+ "&lott_name=" +lott_name+ "&hide=" +hideUnavail+ "&delete=yes\" title=\"Delete Request\" alt=\"Remove Request\" onclick=\"return confirm('Are you sure you want to permanently delete this lottery request?');\">");
out.print("<img src=/" +rev+ "/images/dts_trash.gif width=13 height=13 border=0></a>");
} else {
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
out.print("<img src=/" +rev+ "/images/shim.gif width=5 height=1 border=0>");
out.print("<img src=/" +rev+ "/images/shim.gif width=13 height=13 border=0>");
}
} else {
// in use
out.print("<img src=/" +rev+ "/images/busy.gif width=32 height=13 border=0 alt=\"" + rs.getString("in_use_by") + "\" title=\"Busy\">");
}
out.println("</span>");
//
// Assigned Time
//
if (rs.getInt("in_use") == 0 && !moved) {
out.print(" <span id=lottery_slot_" + slotIndex + "_assignTime hollow=true class=cellData style=\"left: " + lcol_start[2] + "px; width: " + lcol_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
//out.print(" <span id=lottery_slot_" + slotIndex + "_time class=cellData style=\"cursor: default; left: " + lcol_start[3] + "px; width: " + lcol_width[3] + "px; background-color: " +dts_defaultF3Color+ "\">");
} else {
out.print(" <span id=lottery_slot_" + slotIndex + "_assignTime class=cellData style=\"cursor: default; left: " + lcol_start[2] + "px; width: " + lcol_width[2] + "px; background-color: " +dts_defaultF3Color+ "\">");
}
// this could cause a / by zero error is atime has not been assigned yet (done on timer)
switch (group) {
case 1:
if (rs.getInt("atime1") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime1")));
}
break;
case 2:
if (rs.getInt("atime2") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime2")));
}
break;
case 3:
if (rs.getInt("atime3") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime3")));
}
break;
case 4:
if (rs.getInt("atime4") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime4")));
}
break;
case 5:
if (rs.getInt("atime5") == 0) {
out.print("Unassigned");
} else {
out.print(getTime(rs.getInt("atime5")));
}
break;
}
out.print("</span>");
//
// Requested Time
//
out.print(" <span id=lottery_slot_" + slotIndex + "_time class=cellData style=\"cursor: default; left: " + lcol_start[3] + "px; width: " + lcol_width[3] + "px; background-color: " +dts_defaultF3Color+ "\">");
if (!child) out.print(getTime(rs.getInt("time")));
out.print("</span>");
//
// Acceptable Times
//
String ftime = ""; // first acceptable time
String ltime = ""; // last acceptable time
int before = rs.getInt("minsbefore");
int after = rs.getInt("minsafter");
if (before > 0) {
ftime = getTime(SystemUtils.getFirstTime(rs.getInt("time"), before)); // get earliest time for this request
} else {
ftime = getTime(rs.getInt("time"));
}
if (after > 0) {
ltime = getTime(SystemUtils.getLastTime(rs.getInt("time"), after)); // get latest time for this request
} else {
ltime = getTime(rs.getInt("time"));
}
out.print(" <span id=lottery_slot_" + slotIndex + "_oktimes class=cellData style=\"cursor: default; left: " + lcol_start[4] + "px; width: " + lcol_width[4] + "px; background-color: " +dts_defaultF3Color+ "\">");
if (!child && !ftime.equals("")) out.print(ftime + " - " + ltime);
out.print("</span>");
//
// Course
//
if (course.equals( "-ALL-" )) { // only display this col if multi course club
out.print("<span id=lottery_slot_" + slotIndex + "_course class=cellDataC style=\"cursor: default; left: " + lcol_start[5] + "px; width: " + lcol_width[5] + "px; background-color:" + course_color + "\">");
if (!rs.getString("courseName").equals("")) { out.print(fitName(rs.getString("courseName"))); }
out.print("</span>");
}
//
// Weight
//
out.print(" <span id=lottery_slot_" + slotIndex + "_weight class=cellData style=\"cursor: default; left: " + lcol_start[6] + "px; width: " + lcol_width[6] + "px;\">");
out.print(rs.getInt("weight"));
out.print("</span>");
//
// Players
//
out.print("<span id=lottery_slot_" + slotIndex + "_members class=cellDataB value=\"\" style=\"cursor: default; left: " + lcol_start[7] + "px; width: " + lcol_width[7] + "px; text-align: left\"> ");
if (child) out.println(" » ");
//if (child) out.println("<span style=\"position: relative;text-align: left;\"><img src=\"/" +rev+ "/images/dts_child.gif\" width=12 height=12 border=0 valign=top></span>");
out.print(player_list);
if (!rs.getString("notes").equals("")) {
// this won't work in rl but is meant to show a dynamic popup, or we can spawn a small popup window that will show the notes
out.println(" <img src=\"/"+rev+"/images/notes.gif\" width=10 height=12 border=0 alt=\"" + rs.getString("notes") + "\">");
}
out.print("</span>");
/*
out.print("<span class=cellDataB style=\"cursor: default; left: " + lcol_start[6] + "px; width: " + lcol_width[6] + "px\">");
out.print(sum_players);
out.println("</span>");
out.print("<span class=cellDataB style=\"cursor: default; left: " + lcol_start[7] + "px; width: " + lcol_width[7] + "px\">");
*/
//out.print(((nineHole == 0) ? "18" : "9"));
/*
*
if (nineHole == 1 && eighteenHole == 1) {
out.print("mixed");
} else if (nineHole == 1) {
out.print("9");
} else if (eighteenHole == 1) {
out.print("18");
}
*/
out.println("</span>");
out.println("</div>");
} catch (SQLException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
//out.println("</div>");
}
}
private void convert_all(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
}
private void convert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
Statement stmt = null;
ResultSet rs = null;
//
// Get this session's attributes
//
String user = "";
String club = "";
user = (String)session.getAttribute("user");
club = (String)session.getAttribute("club");
int index = 0;
int fives = 0; // for tee time we are dragging to
int count = 0;
int group = 0;
int lottery_id = 0;
int teecurr_id = 0;
boolean overRideFives = false;
String hideUnavail = req.getParameter("hide");
if (hideUnavail == null) hideUnavail = "";
String sindex = req.getParameter("index"); // day index value (needed by _sheet on return)
String returnCourse = req.getParameter("returnCourse"); // name of course to return to (multi)
String suppressEmails = "no";
String slid = "";
String stid = "";
String sgroup = "";
if (req.getParameter("to_tid") != null) stid = req.getParameter("to_tid");
if (req.getParameter("lotteryId") != null) slid = req.getParameter("lotteryId");
if (req.getParameter("group") != null) sgroup = req.getParameter("group");
String convert = req.getParameter("convert");
if (convert == null) convert = "";
String lott_name = req.getParameter("lott_name");
if (lott_name == null) lott_name = "";
if (req.getParameter("overRideFives") != null && req.getParameter("overRideFives").equals("yes")) {
overRideFives = true;
}
if (req.getParameter("suppressEmails") != null) { // if email parm exists
suppressEmails = req.getParameter("suppressEmails");
}
//
// parm block to hold the tee time parms
//
parmSlot slotParms = new parmSlot(); // allocate a parm block
/*
if (convert.equals("auto")) {
// lookup the teecurr_id from the date/time/fb/course that was assigned for this request
try {
PreparedStatement pstmt = con.prepareStatement("" +
"SELECT t.teecurr_id " +
"FROM teecurr2 t, lreqs3 l " +
"WHERE l.id = ? AND l.courseName = t.courseName AND l.atime1 = t.time AND l.afb = t.fb " +
"LIMIT 1");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) teecurr_id = rs.getInt(1);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
} else {
*/
//
// Convert the values from string to int
//
try {
lottery_id = Integer.parseInt(slid);
teecurr_id = Integer.parseInt(stid);
group = Integer.parseInt(sgroup);
index = Integer.parseInt(sindex);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
}
//
// Get fives value for this course (from teecurr_id)
//
if (!overRideFives) {
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 c, teecurr2 t " +
"WHERE c.courseName = t.courseName AND t.teecurr_id = ?");
pstmtc.clearParameters();
pstmtc.setInt(1, teecurr_id);
rs = pstmtc.executeQuery();
if (rs.next()) fives = rs.getInt("fives");
pstmtc.close();
}
catch (Exception e) {
}
} else {
fives = 1;
}
slotParms.ind = index; // index value
slotParms.club = club; // name of club
slotParms.returnCourse = returnCourse; // name of course for return to _sheet
slotParms.suppressEmails = suppressEmails;
//
// Load parameter object
//
try {
PreparedStatement pstmt = con.prepareStatement("SELECT * FROM teecurr2 WHERE teecurr_id = ?");
pstmt.clearParameters();
pstmt.setInt(1, teecurr_id);
rs = pstmt.executeQuery();
if (rs.next()) {
slotParms.player1 = rs.getString("player1");
slotParms.player2 = rs.getString("player2");
slotParms.player3 = rs.getString("player3");
slotParms.player4 = rs.getString("player4");
slotParms.player5 = rs.getString("player5");
slotParms.user1 = rs.getString("username1");
slotParms.user2 = rs.getString("username2");
slotParms.user3 = rs.getString("username3");
slotParms.user4 = rs.getString("username4");
slotParms.user5 = rs.getString("username5");
slotParms.p1cw = rs.getString("p1cw");
slotParms.p2cw = rs.getString("p2cw");
slotParms.p3cw = rs.getString("p3cw");
slotParms.p4cw = rs.getString("p4cw");
slotParms.p5cw = rs.getString("p5cw");
slotParms.in_use = rs.getInt("in_use");
slotParms.in_use_by = rs.getString("in_use_by");
slotParms.userg1 = rs.getString("userg1");
slotParms.userg2 = rs.getString("userg2");
slotParms.userg3 = rs.getString("userg3");
slotParms.userg4 = rs.getString("userg4");
slotParms.userg5 = rs.getString("userg5");
slotParms.orig_by = rs.getString("orig_by");
slotParms.pos1 = rs.getShort("pos1");
slotParms.pos2 = rs.getShort("pos2");
slotParms.pos3 = rs.getShort("pos3");
slotParms.pos4 = rs.getShort("pos4");
slotParms.pos5 = rs.getShort("pos5");
slotParms.rest5 = rs.getString("rest5");
}
out.println("<!-- DONE LOADING slotParms WITH teecurr2 DATA -->");
pstmt.close();
}
catch (Exception e) {
out.println("<p>Error: "+e.toString()+"</p>");
}
// make sure there are enough open player slots
int max_group_size = (fives == 0 || slotParms.p5.equalsIgnoreCase("No")) ? 4 : 5;
int open_slots = 0;
boolean has_players = false;
if (slotParms.player1.equals("")) { open_slots++; } else { has_players = true; }
if (slotParms.player2.equals("")) open_slots++;
if (slotParms.player3.equals("")) open_slots++;
if (slotParms.player4.equals("")) open_slots++;
if (slotParms.player5.equals("") && slotParms.rest5.equals("") && fives == 1 && slotParms.p5.equalsIgnoreCase("Yes")) open_slots++;
if (slotParms.orig_by.equals( "" )) { // if originator field still empty (allow this person to grab this tee time again)
slotParms.orig_by = user; // set this user as the originator
}
out.println("<!-- open_slots="+open_slots+" | has_players="+has_players+" -->");
//
// Check in-use indicators
//
if (slotParms.in_use == 1 && !slotParms.in_use_by.equalsIgnoreCase( user )) { // if time slot in use and not by this user
out.println(SystemUtils.HeadTitle("DB Record In Use Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H1>Reservation Timer Expired</H1>");
out.println("<BR><BR>Sorry, but this tee time slot has been returned to the system!<BR>");
out.println("<BR>The system timed out and released the tee time.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + index + ">");
if (!returnCourse.equals( "" )) { // if multi course club, get course to return to (ALL?)
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
} else {
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.course + "\">");
}
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
boolean teeTimeFull = false;
boolean allowFives = (fives == 1) ? true : false; // does the course we are dragging to allow 5-somes?
String fields = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int groups = 0;
int group_size = 0;
int group_players = 0;
int tmp_added = 0;
int field_offset = 0;
//
// Load lottery request data
//
try {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT l.*, c.fives " +
"FROM lreqs3 l, clubparm2 c " +
"WHERE id = ? AND l.courseName = c.courseName;");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) {
groups = rs.getInt("groups");
group_size = (rs.getInt("fives") == 0 || !rs.getString("p5").equalsIgnoreCase("Yes")) ? 4 : 5;
field_offset = (group - 1) * group_size; // player data pos in rs
player1 = rs.getString(12 + field_offset);
player2 = rs.getString(13 + field_offset);
player3 = rs.getString(14 + field_offset);
player4 = rs.getString(15 + field_offset);
player5 = rs.getString(16 + field_offset);
user1 = rs.getString(37 + field_offset);
user2 = rs.getString(38 + field_offset);
user3 = rs.getString(39 + field_offset);
user4 = rs.getString(40 + field_offset);
user5 = rs.getString(41 + field_offset);
p1cw = rs.getString(62 + field_offset);
p2cw = rs.getString(63 + field_offset);
p3cw = rs.getString(64 + field_offset);
p4cw = rs.getString(65 + field_offset);
p5cw = rs.getString(66 + field_offset);
userg1 = rs.getString(109 + field_offset);
userg2 = rs.getString(110 + field_offset);
userg3 = rs.getString(111 + field_offset);
userg4 = rs.getString(112 + field_offset);
userg5 = rs.getString(113 + field_offset);
p91 = rs.getInt(136 + field_offset);
p92 = rs.getInt(137 + field_offset);
p93 = rs.getInt(138 + field_offset);
p94 = rs.getInt(139 + field_offset);
p95 = rs.getInt(140 + field_offset);
}
if (!player1.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player1, user1, p1cw, p91, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player2.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player2, user2, p2cw, p92, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player3.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player3, user3, p3cw, p93, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player4.equals("")) {
group_players++;
teeTimeFull = addPlayer(slotParms, player4, user4, p4cw, p94, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
if (!player5.equals("") && allowFives && group_size == 5) {
group_players++;
teeTimeFull = addPlayer(slotParms, player5, user5, p5cw, p95, allowFives);
if (!teeTimeFull) { tmp_added++; }
}
} catch(Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
//return;
}
// Let see if all players from this request where moved
if ( teeTimeFull || tmp_added == 0 ) {
out.println(SystemUtils.HeadTitle("Unable to Add All Players"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Unable to Add All Players</H3><BR>");
out.println("<BR>Sorry we were not able to add all the players to this tee time.<br><br>");
out.println("<BR><BR>No changes were made to the lottery request or tee sheet.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"submit\" value=\"Try Again\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
out.println("<!-- field_offset=" + field_offset + " -->");
out.println("<!-- group=" + group + " | max_group_size=" + max_group_size + " -->");
out.println("<!-- groups=" + groups + " | group_size=" + group_size + " | group_players=" + group_players + " -->");
out.println("<!-- lottery_id="+lottery_id+" | teecurr_id="+teecurr_id+" | tmp_added="+tmp_added+" -->");
// first lets see if they are trying to fill the 5th player slot when it is unavailable for this course
if ( !slotParms.player5.equals("") && fives == 0 ) { // ( (!slotParms.rest5.equals("") && overRideFives == false) || fives == 0)
out.println(SystemUtils.HeadTitle("5-some Restricted - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are not allowed on this course.<br><br>");
out.println("<BR><BR>Please move the lottery request to another course.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"submit\" value=\"Try Again\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
/*
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"convert\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"overRideFives\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"lotteryId\" value=\"" + lottery_id + "\">");
out.println("<input type=\"hidden\" name=\"to_tid\" value=\"" + teecurr_id + "\">");
out.println("<input type=\"hidden\" name=\"group\" value=\"" + group + "\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
*/
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} // end 5-some rejection
//
// Update entry in teecurr2
//
try {
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, notes = ?, hideNotes = ?, proNew = ?, proMod = ?, " +
"mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, conf = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ?, pos1 = ?, pos2 = ?, pos3 = ?, pos4 = ?, pos5 = ? " +
"WHERE teecurr_id = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, slotParms.player1);
pstmt6.setString(2, slotParms.player2);
pstmt6.setString(3, slotParms.player3);
pstmt6.setString(4, slotParms.player4);
pstmt6.setString(5, slotParms.user1);
pstmt6.setString(6, slotParms.user2);
pstmt6.setString(7, slotParms.user3);
pstmt6.setString(8, slotParms.user4);
pstmt6.setString(9, slotParms.p1cw);
pstmt6.setString(10, slotParms.p2cw);
pstmt6.setString(11, slotParms.p3cw);
pstmt6.setString(12, slotParms.p4cw);
pstmt6.setFloat(13, slotParms.hndcp1);
pstmt6.setFloat(14, slotParms.hndcp2);
pstmt6.setFloat(15, slotParms.hndcp3);
pstmt6.setFloat(16, slotParms.hndcp4);
pstmt6.setString(17, slotParms.player5);
pstmt6.setString(18, slotParms.user5);
pstmt6.setString(19, slotParms.p5cw);
pstmt6.setFloat(20, slotParms.hndcp5);
pstmt6.setString(21, slotParms.notes);
pstmt6.setInt(22, 0); // hide
pstmt6.setInt(23, 0); // proNew
pstmt6.setInt(24, 0); // proMod
pstmt6.setString(25, slotParms.mNum1);
pstmt6.setString(26, slotParms.mNum2);
pstmt6.setString(27, slotParms.mNum3);
pstmt6.setString(28, slotParms.mNum4);
pstmt6.setString(29, slotParms.mNum5);
pstmt6.setString(30, slotParms.userg1);
pstmt6.setString(31, slotParms.userg2);
pstmt6.setString(32, slotParms.userg3);
pstmt6.setString(33, slotParms.userg4);
pstmt6.setString(34, slotParms.userg5);
pstmt6.setString(35, slotParms.orig_by);
pstmt6.setString(36, slotParms.conf);
pstmt6.setInt(37, slotParms.p91);
pstmt6.setInt(38, slotParms.p92);
pstmt6.setInt(39, slotParms.p93);
pstmt6.setInt(40, slotParms.p94);
pstmt6.setInt(41, slotParms.p95);
pstmt6.setInt(42, slotParms.pos1);
pstmt6.setInt(43, slotParms.pos2);
pstmt6.setInt(44, slotParms.pos3);
pstmt6.setInt(45, slotParms.pos4);
pstmt6.setInt(46, slotParms.pos5);
pstmt6.setInt(47, teecurr_id);
count = pstmt6.executeUpdate(); // execute the prepared stmt
}
catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
// if the tee time was updated then remove the request
if (count == 1) {
// depending on how many groups this request had, we'll either delete or modify the request
if (groups == 1) {
// there was one group in the request - just delete the request
try {
PreparedStatement pstmt = con.prepareStatement("DELETE FROM lreqs3 WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
} else {
// there were multiple groups in this request, lets mark the specific group
int tmp_pos = 0;
int tmp = 0;
int tmp_loop = 1;
// get the position of the first player for the group we moved
if (group == 1)
{ tmp_pos = 0; }
else
{ tmp_pos = group_size * (group - 1); }
// build the fields string for the sql statement
for (tmp = tmp_pos; tmp <= tmp_pos + group_size; tmp++) {
if (tmp_loop > tmp_added) break;
fields = fields + " player" + (tmp + 1) + " = 'MOVED',";
tmp_loop++;
}
// trim trailing comma
fields=fields.substring(0, fields.length() - 1);
out.println("<!-- tmp_pos=" + tmp_pos + " -->");
out.println("<!-- fields=" + fields + " -->");
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE lreqs3 SET " + fields + " WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
// now check all the players in this request and if they equal 'MOVED' then we can delete this request
try {
PreparedStatement pstmt = con.prepareStatement ("" +
"SELECT * FROM lreqs3 WHERE id = ? AND " +
"(player1 = 'MOVED' OR player1 = '') AND " +
"(player2 = 'MOVED' OR player2 = '') AND " +
"(player3 = 'MOVED' OR player3 = '') AND " +
"(player4 = 'MOVED' OR player4 = '') AND " +
"(player5 = 'MOVED' OR player5 = '') AND " +
"(player6 = 'MOVED' OR player6 = '') AND " +
"(player7 = 'MOVED' OR player7 = '') AND " +
"(player8 = 'MOVED' OR player8 = '') AND " +
"(player9 = 'MOVED' OR player9 = '') AND " +
"(player10 = 'MOVED' OR player10 = '') AND " +
"(player11 = 'MOVED' OR player11 = '') AND " +
"(player12 = 'MOVED' OR player12 = '') AND " +
"(player13 = 'MOVED' OR player13 = '') AND " +
"(player14 = 'MOVED' OR player14 = '') AND " +
"(player15 = 'MOVED' OR player15 = '') AND " +
"(player16 = 'MOVED' OR player16 = '') AND " +
"(player17 = 'MOVED' OR player17 = '') AND " +
"(player18 = 'MOVED' OR player18 = '') AND " +
"(player19 = 'MOVED' OR player19 = '') AND " +
"(player20 = 'MOVED' OR player20 = '') AND " +
"(player21 = 'MOVED' OR player21 = '') AND " +
"(player22 = 'MOVED' OR player22 = '') AND " +
"(player23 = 'MOVED' OR player23 = '') AND " +
"(player24 = 'MOVED' OR player24 = '') AND " +
"(player25 = 'MOVED' OR player25 = '');");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery();
if ( rs.next() ) {
pstmt = con.prepareStatement("DELETE FROM lreqs3 WHERE id = ?");
pstmt.clearParameters();
pstmt.setInt(1, lottery_id);
pstmt.executeUpdate();
pstmt.close();
}
pstmt.close();
} catch (Exception exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
}
} // end if updated teecurr2 entry
out.println("<!-- count="+count+" -->");
out.println("<!-- ");
out.println("slotParms.player1=" + slotParms.player1);
out.println("slotParms.player2=" + slotParms.player2);
out.println("slotParms.player3=" + slotParms.player3);
out.println("slotParms.player4=" + slotParms.player4);
out.println("slotParms.player5=" + slotParms.player5);
out.println("");
out.println("slotParms.p1cw=" + slotParms.p1cw);
out.println("slotParms.p2cw=" + slotParms.p2cw);
out.println("slotParms.p3cw=" + slotParms.p3cw);
out.println("slotParms.p4cw=" + slotParms.p4cw);
out.println("slotParms.p5cw=" + slotParms.p5cw);
out.println("");
out.println("slotParms.p91=" + slotParms.p91);
out.println("slotParms.p92=" + slotParms.p92);
out.println("slotParms.p93=" + slotParms.p93);
out.println("slotParms.p94=" + slotParms.p94);
out.println("slotParms.p95=" + slotParms.p95);
out.println("");
out.println("slotParms.mNum1=" + slotParms.mNum1);
out.println("slotParms.mNum2=" + slotParms.mNum2);
out.println("slotParms.mNum3=" + slotParms.mNum3);
out.println("slotParms.mNum4=" + slotParms.mNum4);
out.println("slotParms.mNum5=" + slotParms.mNum5);
out.println("");
out.println(" -->");
//
// Completed update - reload page
//
out.println("<meta http-equiv=\"Refresh\" content=\"2; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&lott_name=" + lott_name + "&hide="+hideUnavail+"\">");
out.close();
return;
}
private void auto_convert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session, HttpServletResponse resp) {
Statement estmt = null;
Statement stmtN = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtd = null;
PreparedStatement pstmtd2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
String course = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String player6 = "";
String player7 = "";
String player8 = "";
String player9 = "";
String player10 = "";
String player11 = "";
String player12 = "";
String player13 = "";
String player14 = "";
String player15 = "";
String player16 = "";
String player17 = "";
String player18 = "";
String player19 = "";
String player20 = "";
String player21 = "";
String player22 = "";
String player23 = "";
String player24 = "";
String player25 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String p6cw = "";
String p7cw = "";
String p8cw = "";
String p9cw = "";
String p10cw = "";
String p11cw = "";
String p12cw = "";
String p13cw = "";
String p14cw = "";
String p15cw = "";
String p16cw = "";
String p17cw = "";
String p18cw = "";
String p19cw = "";
String p20cw = "";
String p21cw = "";
String p22cw = "";
String p23cw = "";
String p24cw = "";
String p25cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String user6 = "";
String user7 = "";
String user8 = "";
String user9 = "";
String user10 = "";
String user11 = "";
String user12 = "";
String user13 = "";
String user14 = "";
String user15 = "";
String user16 = "";
String user17 = "";
String user18 = "";
String user19 = "";
String user20 = "";
String user21 = "";
String user22 = "";
String user23 = "";
String user24 = "";
String user25 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String userg6 = "";
String userg7 = "";
String userg8 = "";
String userg9 = "";
String userg10 = "";
String userg11 = "";
String userg12 = "";
String userg13 = "";
String userg14 = "";
String userg15 = "";
String userg16 = "";
String userg17 = "";
String userg18 = "";
String userg19 = "";
String userg20 = "";
String userg21 = "";
String userg22 = "";
String userg23 = "";
String userg24 = "";
String userg25 = "";
String mNum1 = "";
String mNum2 = "";
String mNum3 = "";
String mNum4 = "";
String mNum5 = "";
String color = "";
String p5 = "";
String type = "";
String pref = "";
String approve = "";
String day = "";
String notes = "";
String in_use_by = "";
String orig_by = "";
String parm = "";
String hndcps = "";
String player5T = "";
String user5T = "";
String p5cwT = "";
String errorMsg = "";
String [] userA = new String [25]; // array to hold usernames
long id = 0;
int date = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int p96 = 0;
int p97 = 0;
int p98 = 0;
int p99 = 0;
int p910 = 0;
int p911 = 0;
int p912 = 0;
int p913 = 0;
int p914 = 0;
int p915 = 0;
int p916 = 0;
int p917 = 0;
int p918 = 0;
int p919 = 0;
int p920 = 0;
int p921 = 0;
int p922 = 0;
int p923 = 0;
int p924 = 0;
int p925 = 0;
int i = 0;
int mm = 0;
int dd = 0;
int yy = 0;
int fb = 0;
int afb = 0;
int afb2 = 0;
int afb3 = 0;
int afb4 = 0;
int afb5 = 0;
int count = 0;
int groups = 0;
int time = 0;
int rtime = 0;
int atime1 = 0;
int atime2 = 0;
int atime3 = 0;
int atime4 = 0;
int atime5 = 0;
int players = 0;
int hide = 0;
int proNew = 0;
int proMod = 0;
int memNew = 0;
int memMod = 0;
int proxMins = 0;
short show1 = 0;
short show2 = 0;
short show3 = 0;
short show4 = 0;
short show5 = 0;
float hndcp1 = 99;
float hndcp2 = 99;
float hndcp3 = 99;
float hndcp4 = 99;
float hndcp5 = 99;
boolean ok = true;
int lottery_id = 0;
int index = 0;
String slid = "";
String sindex = req.getParameter("index");
String hideUnavail = req.getParameter("hide");
String returnCourse = req.getParameter("returnCourse"); // name of course to return to (multi)
if (req.getParameter("lotteryId") != null) slid = req.getParameter("lotteryId");
String name = req.getParameter("lott_name");
if (name == null) name = "";
//
// Get the lottery_id
//
try {
lottery_id = Integer.parseInt(slid);
index = Integer.parseInt(sindex);
}
catch (NumberFormatException exp) {
SystemUtils.buildDatabaseErrMsg(exp.toString(), exp.getMessage(), out, false);
return;
}
try {
errorMsg = "Error in Proshop_dlott:auto_convert (get lottery request): ";
//
// Get the Lottery Requests for the lottery passed
//
pstmt = con.prepareStatement (
"SELECT mm, dd, yy, day, time, " +
"player1, player2, player3, player4, player5, player6, player7, player8, player9, player10, " +
"player11, player12, player13, player14, player15, player16, player17, player18, player19, player20, " +
"player21, player22, player23, player24, player25, " +
"user1, user2, user3, user4, user5, user6, user7, user8, user9, user10, " +
"user11, user12, user13, user14, user15, user16, user17, user18, user19, user20, " +
"user21, user22, user23, user24, user25, " +
"p1cw, p2cw, p3cw, p4cw, p5cw, p6cw, p7cw, p8cw, p9cw, p10cw, " +
"p11cw, p12cw, p13cw, p14cw, p15cw, p16cw, p17cw, p18cw, p19cw, p20cw, " +
"p21cw, p22cw, p23cw, p24cw, p25cw, " +
"notes, hideNotes, fb, proNew, proMod, memNew, memMod, id, groups, atime1, atime2, atime3, " +
"atime4, atime5, afb, p5, players, userg1, userg2, userg3, userg4, userg5, userg6, userg7, userg8, " +
"userg9, userg10, userg11, userg12, userg13, userg14, userg15, userg16, userg17, userg18, userg19, " +
"userg20, userg21, userg22, userg23, userg24, userg25, orig_by, " +
"p91, p92, p93, p94, p95, p96, p97, p98, p99, p910, " +
"p911, p912, p913, p914, p915, p916, p917, p918, p919, p920, " +
"p921, p922, p923, p924, p925, afb2, afb3, afb4, afb5, type, courseName, date " +
"FROM lreqs3 " +
"WHERE id = ? AND state = 2");
pstmt.clearParameters(); // clear the parms
pstmt.setInt(1, lottery_id);
rs = pstmt.executeQuery(); // execute the prepared stmt again to start with first
while (rs.next()) {
mm = rs.getInt(1);
dd = rs.getInt(2);
yy = rs.getInt(3);
day = rs.getString(4);
rtime = rs.getInt(5);
player1 = rs.getString(6);
player2 = rs.getString(7);
player3 = rs.getString(8);
player4 = rs.getString(9);
player5 = rs.getString(10);
player6 = rs.getString(11);
player7 = rs.getString(12);
player8 = rs.getString(13);
player9 = rs.getString(14);
player10 = rs.getString(15);
player11 = rs.getString(16);
player12 = rs.getString(17);
player13 = rs.getString(18);
player14 = rs.getString(19);
player15 = rs.getString(20);
player16 = rs.getString(21);
player17 = rs.getString(22);
player18 = rs.getString(23);
player19 = rs.getString(24);
player20 = rs.getString(25);
player21 = rs.getString(26);
player22 = rs.getString(27);
player23 = rs.getString(28);
player24 = rs.getString(29);
player25 = rs.getString(30);
user1 = rs.getString(31);
user2 = rs.getString(32);
user3 = rs.getString(33);
user4 = rs.getString(34);
user5 = rs.getString(35);
user6 = rs.getString(36);
user7 = rs.getString(37);
user8 = rs.getString(38);
user9 = rs.getString(39);
user10 = rs.getString(40);
user11 = rs.getString(41);
user12 = rs.getString(42);
user13 = rs.getString(43);
user14 = rs.getString(44);
user15 = rs.getString(45);
user16 = rs.getString(46);
user17 = rs.getString(47);
user18 = rs.getString(48);
user19 = rs.getString(49);
user20 = rs.getString(50);
user21 = rs.getString(51);
user22 = rs.getString(52);
user23 = rs.getString(53);
user24 = rs.getString(54);
user25 = rs.getString(55);
p1cw = rs.getString(56);
p2cw = rs.getString(57);
p3cw = rs.getString(58);
p4cw = rs.getString(59);
p5cw = rs.getString(60);
p6cw = rs.getString(61);
p7cw = rs.getString(62);
p8cw = rs.getString(63);
p9cw = rs.getString(64);
p10cw = rs.getString(65);
p11cw = rs.getString(66);
p12cw = rs.getString(67);
p13cw = rs.getString(68);
p14cw = rs.getString(69);
p15cw = rs.getString(70);
p16cw = rs.getString(71);
p17cw = rs.getString(72);
p18cw = rs.getString(73);
p19cw = rs.getString(74);
p20cw = rs.getString(75);
p21cw = rs.getString(76);
p22cw = rs.getString(77);
p23cw = rs.getString(78);
p24cw = rs.getString(79);
p25cw = rs.getString(80);
notes = rs.getString(81);
hide = rs.getInt(82);
fb = rs.getInt(83);
proNew = rs.getInt(84);
proMod = rs.getInt(85);
memNew = rs.getInt(86);
memMod = rs.getInt(87);
id = rs.getLong(88);
groups = rs.getInt(89);
atime1 = rs.getInt(90);
atime2 = rs.getInt(91);
atime3 = rs.getInt(92);
atime4 = rs.getInt(93);
atime5 = rs.getInt(94);
afb = rs.getInt(95);
p5 = rs.getString(96);
players = rs.getInt(97);
userg1 = rs.getString(98);
userg2 = rs.getString(99);
userg3 = rs.getString(100);
userg4 = rs.getString(101);
userg5 = rs.getString(102);
userg6 = rs.getString(103);
userg7 = rs.getString(104);
userg8 = rs.getString(105);
userg9 = rs.getString(106);
userg10 = rs.getString(107);
userg11 = rs.getString(108);
userg12 = rs.getString(109);
userg13 = rs.getString(110);
userg14 = rs.getString(111);
userg15 = rs.getString(112);
userg16 = rs.getString(113);
userg17 = rs.getString(114);
userg18 = rs.getString(115);
userg19 = rs.getString(116);
userg20 = rs.getString(117);
userg21 = rs.getString(118);
userg22 = rs.getString(119);
userg23 = rs.getString(120);
userg24 = rs.getString(121);
userg25 = rs.getString(122);
orig_by = rs.getString(123);
p91 = rs.getInt(124);
p92 = rs.getInt(125);
p93 = rs.getInt(126);
p94 = rs.getInt(127);
p95 = rs.getInt(128);
p96 = rs.getInt(129);
p97 = rs.getInt(130);
p98 = rs.getInt(131);
p99 = rs.getInt(132);
p910 = rs.getInt(133);
p911 = rs.getInt(134);
p912 = rs.getInt(135);
p913 = rs.getInt(136);
p914 = rs.getInt(137);
p915 = rs.getInt(138);
p916 = rs.getInt(139);
p917 = rs.getInt(140);
p918 = rs.getInt(141);
p919 = rs.getInt(142);
p920 = rs.getInt(143);
p921 = rs.getInt(144);
p922 = rs.getInt(145);
p923 = rs.getInt(146);
p924 = rs.getInt(147);
p925 = rs.getInt(148);
afb2 = rs.getInt(149);
afb3 = rs.getInt(150);
afb4 = rs.getInt(151);
afb5 = rs.getInt(152);
type = rs.getString(153);
course = rs.getString(154);
date = rs.getInt(155);
if (atime1 != 0) { // only process if its assigned
ok = SystemUtils.checkInUse(con, id); // check if assigned tee times are currently in use
if (ok == true) { // if ok to proceed (no tee times are in use)
//
// Save the usernames
//
userA[0] = user1;
userA[1] = user2;
userA[2] = user3;
userA[3] = user4;
userA[4] = user5;
userA[5] = user6;
userA[6] = user7;
userA[7] = user8;
userA[8] = user9;
userA[9] = user10;
userA[10] = user11;
userA[11] = user12;
userA[12] = user13;
userA[13] = user14;
userA[14] = user15;
userA[15] = user16;
userA[16] = user17;
userA[17] = user18;
userA[18] = user19;
userA[19] = user20;
userA[20] = user21;
userA[21] = user22;
userA[22] = user23;
userA[23] = user24;
userA[24] = user25;
//
// create 1 tee time for each group requested (groups = )
//
time = atime1; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
//
// Save area for tee time and email processing - by groups
//
String g1user1 = user1;
String g1user2 = user2;
String g1user3 = user3;
String g1user4 = user4;
String g1user5 = "";
String g1player1 = player1;
String g1player2 = player2;
String g1player3 = player3;
String g1player4 = player4;
String g1player5 = "";
String g1p1cw = p1cw;
String g1p2cw = p2cw;
String g1p3cw = p3cw;
String g1p4cw = p4cw;
String g1p5cw = "";
String g1userg1 = userg1;
String g1userg2 = userg2;
String g1userg3 = userg3;
String g1userg4 = userg4;
String g1userg5 = "";
int g1p91 = p91;
int g1p92 = p92;
int g1p93 = p93;
int g1p94 = p94;
int g1p95 = 0;
String g2user1 = "";
String g2user2 = "";
String g2user3 = "";
String g2user4 = "";
String g2user5 = "";
String g2player1 = "";
String g2player2 = "";
String g2player3 = "";
String g2player4 = "";
String g2player5 = "";
String g2p1cw = "";
String g2p2cw = "";
String g2p3cw = "";
String g2p4cw = "";
String g2p5cw = "";
String g2userg1 = "";
String g2userg2 = "";
String g2userg3 = "";
String g2userg4 = "";
String g2userg5 = "";
int g2p91 = 0;
int g2p92 = 0;
int g2p93 = 0;
int g2p94 = 0;
int g2p95 = 0;
String g3user1 = "";
String g3user2 = "";
String g3user3 = "";
String g3user4 = "";
String g3user5 = "";
String g3player1 = "";
String g3player2 = "";
String g3player3 = "";
String g3player4 = "";
String g3player5 = "";
String g3p1cw = "";
String g3p2cw = "";
String g3p3cw = "";
String g3p4cw = "";
String g3p5cw = "";
String g3userg1 = "";
String g3userg2 = "";
String g3userg3 = "";
String g3userg4 = "";
String g3userg5 = "";
int g3p91 = 0;
int g3p92 = 0;
int g3p93 = 0;
int g3p94 = 0;
int g3p95 = 0;
String g4user1 = "";
String g4user2 = "";
String g4user3 = "";
String g4user4 = "";
String g4user5 = "";
String g4player1 = "";
String g4player2 = "";
String g4player3 = "";
String g4player4 = "";
String g4player5 = "";
String g4p1cw = "";
String g4p2cw = "";
String g4p3cw = "";
String g4p4cw = "";
String g4p5cw = "";
String g4userg1 = "";
String g4userg2 = "";
String g4userg3 = "";
String g4userg4 = "";
String g4userg5 = "";
int g4p91 = 0;
int g4p92 = 0;
int g4p93 = 0;
int g4p94 = 0;
int g4p95 = 0;
String g5user1 = "";
String g5user2 = "";
String g5user3 = "";
String g5user4 = "";
String g5user5 = "";
String g5player1 = "";
String g5player2 = "";
String g5player3 = "";
String g5player4 = "";
String g5player5 = "";
String g5p1cw = "";
String g5p2cw = "";
String g5p3cw = "";
String g5p4cw = "";
String g5p5cw = "";
String g5userg1 = "";
String g5userg2 = "";
String g5userg3 = "";
String g5userg4 = "";
String g5userg5 = "";
int g5p91 = 0;
int g5p92 = 0;
int g5p93 = 0;
int g5p94 = 0;
int g5p95 = 0;
errorMsg = "Error in SystemUtils moveReqs (get mem# and hndcp): ";
//
// Get Member# and Handicap for each member
//
if (!user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
g1player5 = player5;
g1user5 = user5;
g1p5cw = p5cw;
g1userg5 = userg5;
g1p95 = p95;
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 1 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g1player1);
pstmt6.setString(2, g1player2);
pstmt6.setString(3, g1player3);
pstmt6.setString(4, g1player4);
pstmt6.setString(5, g1user1);
pstmt6.setString(6, g1user2);
pstmt6.setString(7, g1user3);
pstmt6.setString(8, g1user4);
pstmt6.setString(9, g1p1cw);
pstmt6.setString(10, g1p2cw);
pstmt6.setString(11, g1p3cw);
pstmt6.setString(12, g1p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g1player5);
pstmt6.setString(18, g1user5);
pstmt6.setString(19, g1p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g1userg1);
pstmt6.setString(33, g1userg2);
pstmt6.setString(34, g1userg3);
pstmt6.setString(35, g1userg4);
pstmt6.setString(36, g1userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g1p91);
pstmt6.setInt(39, g1p92);
pstmt6.setInt(40, g1p93);
pstmt6.setInt(41, g1p94);
pstmt6.setInt(42, g1p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
//
// Do next group, if there is one
//
if (groups > 1 && count != 0) {
time = atime2; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g2player1 = player6;
g2player2 = player7;
g2player3 = player8;
g2player4 = player9;
g2player5 = player10;
g2user1 = user6;
g2user2 = user7;
g2user3 = user8;
g2user4 = user9;
g2user5 = user10;
g2p1cw = p6cw;
g2p2cw = p7cw;
g2p3cw = p8cw;
g2p4cw = p9cw;
g2p5cw = p10cw;
g2userg1 = userg6;
g2userg2 = userg7;
g2userg3 = userg8;
g2userg4 = userg9;
g2userg5 = userg10;
g2p91 = p96;
g2p92 = p97;
g2p93 = p98;
g2p94 = p99;
g2p95 = p910;
} else {
g2player1 = player5;
g2player2 = player6;
g2player3 = player7;
g2player4 = player8;
g2user1 = user5;
g2user2 = user6;
g2user3 = user7;
g2user4 = user8;
g2p1cw = p5cw;
g2p2cw = p6cw;
g2p3cw = p7cw;
g2p4cw = p8cw;
g2userg1 = userg5;
g2userg2 = userg6;
g2userg3 = userg7;
g2userg4 = userg8;
g2p91 = p95;
g2p92 = p96;
g2p93 = p97;
g2p94 = p98;
}
if (!g2user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g2user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g2user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 2 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g2player1);
pstmt6.setString(2, g2player2);
pstmt6.setString(3, g2player3);
pstmt6.setString(4, g2player4);
pstmt6.setString(5, g2user1);
pstmt6.setString(6, g2user2);
pstmt6.setString(7, g2user3);
pstmt6.setString(8, g2user4);
pstmt6.setString(9, g2p1cw);
pstmt6.setString(10, g2p2cw);
pstmt6.setString(11, g2p3cw);
pstmt6.setString(12, g2p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g2player5);
pstmt6.setString(18, g2user5);
pstmt6.setString(19, g2p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g2userg1);
pstmt6.setString(33, g2userg2);
pstmt6.setString(34, g2userg3);
pstmt6.setString(35, g2userg4);
pstmt6.setString(36, g2userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g2p91);
pstmt6.setInt(39, g2p92);
pstmt6.setInt(40, g2p93);
pstmt6.setInt(41, g2p94);
pstmt6.setInt(42, g2p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb2);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 2 && count != 0) {
time = atime3; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g3player1 = player11;
g3player2 = player12;
g3player3 = player13;
g3player4 = player14;
g3player5 = player15;
g3user1 = user11;
g3user2 = user12;
g3user3 = user13;
g3user4 = user14;
g3user5 = user15;
g3p1cw = p11cw;
g3p2cw = p12cw;
g3p3cw = p13cw;
g3p4cw = p14cw;
g3p5cw = p15cw;
g3userg1 = userg11;
g3userg2 = userg12;
g3userg3 = userg13;
g3userg4 = userg14;
g3userg5 = userg15;
g3p91 = p911;
g3p92 = p912;
g3p93 = p913;
g3p94 = p914;
g3p95 = p915;
} else {
g3player1 = player9;
g3player2 = player10;
g3player3 = player11;
g3player4 = player12;
g3user1 = user9;
g3user2 = user10;
g3user3 = user11;
g3user4 = user12;
g3p1cw = p9cw;
g3p2cw = p10cw;
g3p3cw = p11cw;
g3p4cw = p12cw;
g3userg1 = userg9;
g3userg2 = userg10;
g3userg3 = userg11;
g3userg4 = userg12;
g3p91 = p99;
g3p92 = p910;
g3p93 = p911;
g3p94 = p912;
}
if (!g3user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g3user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g3user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g3user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 3 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g3player1);
pstmt6.setString(2, g3player2);
pstmt6.setString(3, g3player3);
pstmt6.setString(4, g3player4);
pstmt6.setString(5, g3user1);
pstmt6.setString(6, g3user2);
pstmt6.setString(7, g3user3);
pstmt6.setString(8, g3user4);
pstmt6.setString(9, g3p1cw);
pstmt6.setString(10, g3p2cw);
pstmt6.setString(11, g3p3cw);
pstmt6.setString(12, g3p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g3player5);
pstmt6.setString(18, g3user5);
pstmt6.setString(19, g3p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g3userg1);
pstmt6.setString(33, g3userg2);
pstmt6.setString(34, g3userg3);
pstmt6.setString(35, g3userg4);
pstmt6.setString(36, g3userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g3p91);
pstmt6.setInt(39, g3p92);
pstmt6.setInt(40, g3p93);
pstmt6.setInt(41, g3p94);
pstmt6.setInt(42, g3p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb3);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 3 && count != 0) {
time = atime4; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g4player1 = player16;
g4player2 = player17;
g4player3 = player18;
g4player4 = player19;
g4player5 = player20;
g4user1 = user16;
g4user2 = user17;
g4user3 = user18;
g4user4 = user19;
g4user5 = user20;
g4p1cw = p16cw;
g4p2cw = p17cw;
g4p3cw = p18cw;
g4p4cw = p19cw;
g4p5cw = p20cw;
g4userg1 = userg16;
g4userg2 = userg17;
g4userg3 = userg18;
g4userg4 = userg19;
g4userg5 = userg20;
g4p91 = p916;
g4p92 = p917;
g4p93 = p918;
g4p94 = p919;
g4p95 = p920;
} else {
g4player1 = player13;
g4player2 = player14;
g4player3 = player15;
g4player4 = player16;
g4user1 = user13;
g4user2 = user14;
g4user3 = user15;
g4user4 = user16;
g4p1cw = p13cw;
g4p2cw = p14cw;
g4p3cw = p15cw;
g4p4cw = p16cw;
g4userg1 = userg13;
g4userg2 = userg14;
g4userg3 = userg15;
g4userg4 = userg16;
g4p91 = p913;
g4p92 = p914;
g4p93 = p915;
g4p94 = p916;
}
if (!g4user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g4user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g4user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g4user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 4 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g4player1);
pstmt6.setString(2, g4player2);
pstmt6.setString(3, g4player3);
pstmt6.setString(4, g4player4);
pstmt6.setString(5, g4user1);
pstmt6.setString(6, g4user2);
pstmt6.setString(7, g4user3);
pstmt6.setString(8, g4user4);
pstmt6.setString(9, g4p1cw);
pstmt6.setString(10, g4p2cw);
pstmt6.setString(11, g4p3cw);
pstmt6.setString(12, g4p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g4player5);
pstmt6.setString(18, g4user5);
pstmt6.setString(19, g4p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g4userg1);
pstmt6.setString(33, g4userg2);
pstmt6.setString(34, g4userg3);
pstmt6.setString(35, g4userg4);
pstmt6.setString(36, g4userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g4p91);
pstmt6.setInt(39, g4p92);
pstmt6.setInt(40, g4p93);
pstmt6.setInt(41, g4p94);
pstmt6.setInt(42, g4p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb4);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
//
// Do next group, if there is one
//
if (groups > 4 && count != 0) {
time = atime5; // time for this tee time
hndcp1 = 99; // init
hndcp2 = 99;
hndcp3 = 99;
hndcp4 = 99;
hndcp5 = 99;
mNum1 = "";
mNum2 = "";
mNum3 = "";
mNum4 = "";
mNum5 = "";
if (p5.equals( "Yes" )) {
g5player1 = player21;
g5player2 = player22;
g5player3 = player23;
g5player4 = player24;
g5player5 = player25;
g5user1 = user21;
g5user2 = user22;
g5user3 = user23;
g5user4 = user24;
g5user5 = user25;
g5p1cw = p21cw;
g5p2cw = p22cw;
g5p3cw = p23cw;
g5p4cw = p24cw;
g5p5cw = p25cw;
g5userg1 = userg21;
g5userg2 = userg22;
g5userg3 = userg23;
g5userg4 = userg24;
g5userg5 = userg25;
g5p91 = p921;
g5p92 = p922;
g5p93 = p923;
g5p94 = p924;
g5p95 = p925;
} else {
g5player1 = player17;
g5player2 = player18;
g5player3 = player19;
g5player4 = player20;
g5user1 = user17;
g5user2 = user18;
g5user3 = user19;
g5user4 = user20;
g5p1cw = p17cw;
g5p2cw = p18cw;
g5p3cw = p19cw;
g5p4cw = p20cw;
g5userg1 = userg17;
g5userg2 = userg18;
g5userg3 = userg19;
g5userg4 = userg20;
g5p91 = p917;
g5p92 = p918;
g5p93 = p919;
g5p94 = p920;
}
if (!g5user1.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user1); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum1 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp1 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user2.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user2); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum2 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp2 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user3.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user3); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum3 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp3 = Float.parseFloat(hndcps); // convert back to floating int
}
if (!g5user4.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user4); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum4 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp4 = Float.parseFloat(hndcps); // convert back to floating int
}
if (p5.equals( "Yes" )) {
if (!g5user5.equals( "" )) { // if player is a member
parm = SystemUtils.getUser(con, g5user5); // get mNum and hndcp for member
StringTokenizer tok = new StringTokenizer( parm, "," ); // delimiters are comma - parse the parm
mNum5 = tok.nextToken(); // member Number
hndcps = tok.nextToken(); // handicap
hndcp5 = Float.parseFloat(hndcps); // convert back to floating int
}
}
if (mNum1.equals( "*@&" )) { // if garbage so parm would work
mNum1 = ""; // convert back to null
}
if (mNum2.equals( "*@&" )) { // if garbage so parm would work
mNum2 = ""; // convert back to null
}
if (mNum3.equals( "*@&" )) { // if garbage so parm would work
mNum3 = ""; // convert back to null
}
if (mNum4.equals( "*@&" )) { // if garbage so parm would work
mNum4 = ""; // convert back to null
}
if (mNum5.equals( "*@&" )) { // if garbage so parm would work
mNum5 = ""; // convert back to null
}
errorMsg = "Error in SystemUtils moveReqs (put group 5 in tee sheet): ";
//
// Update the tee slot in teecurr
//
// Clear the lottery name so this tee time is displayed in _sheet even though there
// may be some requests still outstanding (state = 4).
//
pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = 0, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = 0, show2 = 0, show3 = 0, show4 = 0, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = 0, notes = ?, hideNotes = ?, lottery = '', proNew = ?, proMod = ?, " +
"memNew = ?, memMod = ?, mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, g5player1);
pstmt6.setString(2, g5player2);
pstmt6.setString(3, g5player3);
pstmt6.setString(4, g5player4);
pstmt6.setString(5, g5user1);
pstmt6.setString(6, g5user2);
pstmt6.setString(7, g5user3);
pstmt6.setString(8, g5user4);
pstmt6.setString(9, g5p1cw);
pstmt6.setString(10, g5p2cw);
pstmt6.setString(11, g5p3cw);
pstmt6.setString(12, g5p4cw);
pstmt6.setFloat(13, hndcp1);
pstmt6.setFloat(14, hndcp2);
pstmt6.setFloat(15, hndcp3);
pstmt6.setFloat(16, hndcp4);
pstmt6.setString(17, g5player5);
pstmt6.setString(18, g5user5);
pstmt6.setString(19, g5p5cw);
pstmt6.setFloat(20, hndcp5);
pstmt6.setString(21, notes);
pstmt6.setInt(22, hide);
pstmt6.setInt(23, proNew);
pstmt6.setInt(24, proMod);
pstmt6.setInt(25, memNew);
pstmt6.setInt(26, memMod);
pstmt6.setString(27, mNum1);
pstmt6.setString(28, mNum2);
pstmt6.setString(29, mNum3);
pstmt6.setString(30, mNum4);
pstmt6.setString(31, mNum5);
pstmt6.setString(32, g5userg1);
pstmt6.setString(33, g5userg2);
pstmt6.setString(34, g5userg3);
pstmt6.setString(35, g5userg4);
pstmt6.setString(36, g5userg5);
pstmt6.setString(37, orig_by);
pstmt6.setInt(38, g5p91);
pstmt6.setInt(39, g5p92);
pstmt6.setInt(40, g5p93);
pstmt6.setInt(41, g5p94);
pstmt6.setInt(42, g5p95);
pstmt6.setLong(43, date);
pstmt6.setInt(44, time);
pstmt6.setInt(45, afb5);
pstmt6.setString(46, course);
count = pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
} // end of IF groups
/*
//*****************************************************************************
// Send an email to all in this request
//*****************************************************************************
//
errorMsg = "Error in SystemUtils moveReqs (send email): ";
String clubName = "";
try {
estmt = con.createStatement(); // create a statement
rs2 = estmt.executeQuery("SELECT clubName " +
"FROM club5 WHERE clubName != ''");
if (rs2.next()) {
clubName = rs2.getString(1);
}
estmt.close();
}
catch (Exception ignore) {
}
//
// Get today's date and time for email processing
//
Calendar ecal = new GregorianCalendar(); // get todays date
int eyear = ecal.get(Calendar.YEAR);
int emonth = ecal.get(Calendar.MONTH);
int eday = ecal.get(Calendar.DAY_OF_MONTH);
int e_hourDay = ecal.get(Calendar.HOUR_OF_DAY);
int e_min = ecal.get(Calendar.MINUTE);
int e_time = 0;
long e_date = 0;
//
// Build the 'time' string for display
//
// Adjust the time based on the club's time zone (we are Central)
//
e_time = (e_hourDay * 100) + e_min;
e_time = SystemUtils.adjustTime(con, e_time); // adjust for time zone
if (e_time < 0) { // if negative, then we went back or ahead one day
e_time = 0 - e_time; // convert back to positive value
if (e_time < 100) { // if hour is zero, then we rolled ahead 1 day
//
// roll cal ahead 1 day (its now just after midnight, the next day Eastern Time)
//
ecal.add(Calendar.DATE,1); // get next day's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
} else { // we rolled back 1 day
//
// roll cal back 1 day (its now just before midnight, yesterday Pacific or Mountain Time)
//
ecal.add(Calendar.DATE,-1); // get yesterday's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
}
}
int e_hour = e_time / 100; // get adjusted hour
e_min = e_time - (e_hour * 100); // get minute value
int e_am_pm = 0; // preset to AM
if (e_hour > 11) {
e_am_pm = 1; // PM
e_hour = e_hour - 12; // set to 12 hr clock
}
if (e_hour == 0) {
e_hour = 12;
}
String email_time = "";
emonth = emonth + 1; // month starts at zero
e_date = (eyear * 10000) + (emonth * 100) + eday;
//
// get date/time string for email message
//
if (e_am_pm == 0) {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " AM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " AM";
}
} else {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " PM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " PM";
}
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
String to = ""; // to address
String f_b = "";
String eampm = "";
String etime = "";
String enewMsg = "";
int emailOpt = 0; // user's email option parm
int ehr = 0;
int emin = 0;
int send = 0;
PreparedStatement pstmte1 = null;
//
// set the front/back value
//
f_b = "Front";
if (afb == 1) {
f_b = "Back";
}
String enew1 = "";
String enew2 = "";
String subject = "";
if (clubName.startsWith( "Old Oaks" )) {
enew1 = "The following Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Tee Time Assignment Notification";
} else {
if (clubName.startsWith( "Westchester" )) {
enew1 = "The following Draw Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Draw Tee Times have been ASSIGNED.\n\n";
subject = "Your Tee Time for Weekend Draw";
} else {
enew1 = "The following Lottery Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Lottery Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Lottery Assignment Notification";
}
}
if (!clubName.equals( "" )) {
subject = subject + " - " + clubName;
}
Properties properties = new Properties();
properties.put("mail.smtp.host", SystemUtils.host); // set outbound host address
properties.put("mail.smtp.port", SystemUtils.port); // set outbound port
properties.put("mail.smtp.auth", "true"); // set 'use authentication'
Session mailSess = Session.getInstance(properties, SystemUtils.getAuthenticator()); // get session properties
MimeMessage message = new MimeMessage(mailSess);
try {
message.setFrom(new InternetAddress(SystemUtils.EFROM)); // set from addr
message.setSubject( subject ); // set subject line
message.setSentDate(new java.util.Date()); // set date/time sent
}
catch (Exception ignore) {
}
//
// Set the recipient addresses
//
if (!g1user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
//
// send email if anyone to send it to
//
if (send != 0) { // if any email addresses specified for members
//
// Create the message content
//
if (groups > 1) {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
} else {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
}
if (!course.equals( "" )) {
enewMsg = enewMsg + "of Course: " + course;
}
//
// convert time to hour and minutes for email msg
//
time = atime1; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n at " + etime + "\n";
if (!g1player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g1player1 + " " + g1p1cw;
}
if (!g1player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g1player2 + " " + g1p2cw;
}
if (!g1player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g1player3 + " " + g1p3cw;
}
if (!g1player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g1player4 + " " + g1p4cw;
}
if (!g1player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g1player5 + " " + g1p5cw;
}
if (groups > 1) {
time = atime2; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g2player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g2player1 + " " + g2p1cw;
}
if (!g2player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g2player2 + " " + g2p2cw;
}
if (!g2player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g2player3 + " " + g2p3cw;
}
if (!g2player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g2player4 + " " + g2p4cw;
}
if (!g2player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g2player5 + " " + g2p5cw;
}
}
if (groups > 2) {
time = atime3; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g3player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g3player1 + " " + g3p1cw;
}
if (!g3player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g3player2 + " " + g3p2cw;
}
if (!g3player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g3player3 + " " + g3p3cw;
}
if (!g3player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g3player4 + " " + g3p4cw;
}
if (!g3player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g3player5 + " " + g3p5cw;
}
}
if (groups > 3) {
time = atime4; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g4player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g4player1 + " " + g4p1cw;
}
if (!g4player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g4player2 + " " + g4p2cw;
}
if (!g4player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g4player3 + " " + g4p3cw;
}
if (!g4player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g4player4 + " " + g4p4cw;
}
if (!g4player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g4player5 + " " + g4p5cw;
}
}
if (groups > 4) {
time = atime5; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g5player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g5player1 + " " + g5p1cw;
}
if (!g5player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g5player2 + " " + g5p2cw;
}
if (!g5player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g5player3 + " " + g5p3cw;
}
if (!g5player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g5player4 + " " + g5p4cw;
}
if (!g5player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g5player5 + " " + g5p5cw;
}
}
enewMsg = enewMsg + SystemUtils.trailer;
try {
message.setText( enewMsg ); // put msg in email text area
Transport.send(message); // send it!!
}
catch (Exception ignore) {
}
} // end of IF send
*/
if (count == 0) {
// we were not able to update the tee time(s) to contain all requested times in the lottery
out.println(SystemUtils.HeadTitle("Error Converting Lottery Request"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Error Converting Lottery Request");
out.println("<BR>The assigned tee time was not found for this lottery request. You may have to insert the assigned tee time and try again.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + name + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
} else {
//
// delete the request after players have been moved
//
pstmtd = con.prepareStatement (
"DELETE FROM lreqs3 WHERE id = ?");
pstmtd.clearParameters();
pstmtd.setLong(1, id);
pstmtd.executeUpdate();
pstmtd.close();
}
//
// If lottery type = Weighted By Proximity, determine time between request and assigned
//
if (type.equals( "WeightedBP" )) {
proxMins = SystemUtils.calcProxTime(rtime, atime1); // calculate mins difference
pstmtd2 = con.prepareStatement (
"INSERT INTO lassigns5 (username, lname, date, mins) " +
"VALUES (?, ?, ?, ?)");
//
// Save each members' weight for this request
//
for (i=0; i<25; i++) { // check all 25 possible players
if (!userA[i].equals( "" )) { // if player is a member
pstmtd2.clearParameters();
pstmtd2.setString(1, userA[i]);
pstmtd2.setString(2, name);
pstmtd2.setLong(3, date);
pstmtd2.setInt(4, proxMins);
pstmtd2.executeUpdate();
}
}
pstmtd2.close();
} // end of IF Weighted by Proximity lottery type
} // end of IF ok (tee times in use?)
else {
// we were not able to update the tee time(s) to contain all requested times in the lottery
out.println(SystemUtils.HeadTitle("Error Converting Lottery Request"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Tee Time Busy or Occupied</H3>");
out.println("<BR><BR>Error Converting Lottery Request");
out.println("<BR>The assigned tee time for this lottery request is either busy or is already occupied with players.");
out.println("<BR>If the lottery request has multiple groups within, it could be one of the groups assigned times that are busy or occupied.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + name + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
} // end if tee time busy or full
} else { // req is NOT assigned
//
// Change the state to 5 (processed & approved) so _sheet will show the others
//
PreparedStatement pstmt7s = con.prepareStatement (
"UPDATE lreqs3 SET state = 5 " +
"WHERE id = ?");
pstmt7s.clearParameters(); // clear the parms
pstmt7s.setLong(1, id);
pstmt7s.executeUpdate();
pstmt7s.close();
} // end of IF req is assigned
} // end of WHILE lreqs - process next request
pstmt.close();
}
catch (Exception e1) {
//
// save error message in /v_x/error.txt
//
errorMsg = errorMsg + e1.getMessage();
SystemUtils.buildDatabaseErrMsg(e1.toString(), errorMsg, out, false);
return;
}
//
// Completed update - reload page
//
out.println("<meta http-equiv=\"Refresh\" content=\"2; url=/" +rev+ "/servlet/Proshop_dlott?index=" + index + "&course=" + returnCourse + "&lott_name=" + name + "&hide="+hideUnavail+"\">");
out.close();
} // end auto_convert method
//
// Add player to slot
//
private static boolean addPlayer(parmSlot slotParms, String player_name, String username, String cw, int p9hole, boolean allowFives) {
if (slotParms.player1.equals("")) {
slotParms.player1 = player_name;
slotParms.user1 = username;
slotParms.p1cw = cw;
slotParms.p91 = p9hole;
} else if (slotParms.player2.equals("")) {
slotParms.player2 = player_name;
slotParms.user2 = username;
slotParms.p2cw = cw;
slotParms.p92 = p9hole;
} else if (slotParms.player3.equals("")) {
slotParms.player3 = player_name;
slotParms.user3 = username;
slotParms.p3cw = cw;
slotParms.p93 = p9hole;
} else if (slotParms.player4.equals("")) {
slotParms.player4 = player_name;
slotParms.user4 = username;
slotParms.p4cw = cw;
slotParms.p94 = p9hole;
} else if (slotParms.player5.equals("") && allowFives) {
slotParms.player5 = player_name;
slotParms.user5 = username;
slotParms.p5cw = cw;
slotParms.p95 = p9hole;
} else {
return (true);
}
return (false);
}
// *********************************************************
// Process delete request from above
//
// parms: index = index value for date
// course = name of course
// returnCourse = name of course for return to sheet
// jump = jump index for return
// time = time of tee time
// fb = f/b indicator
//
// *********************************************************
private void doDelete(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
ResultSet rs = null;
//
// variables for this class
//
int index = 0;
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int fb = 0;
int hr = 0;
int min = 0;
int time = 0;
String sampm = "AM";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// The 'index' paramter contains an index value
// (0 = today, 1 = tomorrow, etc.)
//
String indexs = req.getParameter("index"); // index value of the day
String course = req.getParameter("course"); // get the course name for this delete request
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String stime = req.getParameter("time"); // get the time of tee time
String sfb = req.getParameter("fb"); // get the fb indicator
String emailOpt = req.getParameter("email"); // get the email indicator
String hide = req.getParameter("hide");
String lott_name = req.getParameter("lott_name");
if (course == null) {
course = ""; // change to null string
}
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(indexs);
fb = Integer.parseInt(sfb);
time = Integer.parseInt(stime);
}
catch (NumberFormatException e) {
// ignore error
}
//
// isolate hr and min values
//
hr = time / 100;
min = time - (hr * 100);
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead 'index' days
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH);
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
month = month + 1; // month starts at zero
String day_name = day_table[day_num]; // get name for day
long date = year * 10000; // create a date field of yyyymmdd
date = date + (month * 100);
date = date + day; // date = yyyymmdd (for comparisons)
if (req.getParameter("deleteSubmit") == null) { // if this is the first request
//
// Call is from 'edit' processing above to start a delete request
//
//
// Build the HTML page to prompt user for a confirmation
//
out.println(SystemUtils.HeadTitle("Proshop Delete Confirmation"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\"></font><center>");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\" valign=\"top\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // main page
out.println("<tr><td align=\"center\">");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\" color=\"#000000\"><br><br>");
out.println("<table border=\"2\" bgcolor=\"#F5F5DC\" cellpadding=\"8\" align=\"center\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"time\" value=\"" + time + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"fb\" value=\"" + fb + "\">");
out.println("<input type=\"hidden\" name=\"delete\" value=\"yes\">");
out.println("<tr><td width=\"450\">");
out.println("<font size=\"3\">");
out.println("<p align=\"center\"><b>Delete Confirmation</b></p></font>");
out.println("<br><font size=\"2\">");
out.println("<font size=\"2\">");
out.println("<p align=\"left\">");
//
// Check to see if any players are in this tee time
//
try {
PreparedStatement pstmt1d = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1d.clearParameters(); // clear the parms
pstmt1d.setLong(1, date);
pstmt1d.setInt(2, time);
pstmt1d.setInt(3, fb);
pstmt1d.setString(4, course);
rs = pstmt1d.executeQuery(); // execute the prepared stmt
if (rs.next()) {
player1 = rs.getString(1);
player2 = rs.getString(2);
player3 = rs.getString(3);
player4 = rs.getString(4);
player5 = rs.getString(5);
}
pstmt1d.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
if (!player1.equals( "" ) || !player2.equals( "" ) || !player3.equals( "" ) || !player4.equals( "" ) || !player5.equals( "" )) {
out.println("<b>Warning:</b> You are about to permanently remove a tee time ");
out.println("which contains the following player(s):<br>");
if (!player1.equals( "" )) {
out.println("<br>" +player1);
}
if (!player2.equals( "" )) {
out.println("<br>" +player2);
}
if (!player3.equals( "" )) {
out.println("<br>" +player3);
}
if (!player4.equals( "" )) {
out.println("<br>" +player4);
}
if (!player5.equals( "" )) {
out.println("<br>" +player5);
}
out.println("<br><br>This will remove the entire tee time slot from the database. ");
out.println(" If you wish to only remove the players, then return to the tee sheet and select the tee time to update it.");
out.println("</p>");
} else {
out.println("<b>Warning:</b> You are about to permanently remove the following tee time.<br><br>");
out.println("This will remove the entire tee time slot from the database. ");
out.println(" If you wish to only remove the players, then return to the tee sheet and select the tee time to update it.");
out.println("</p>");
}
//
// build the time string
//
sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
out.println("<p align=\"center\">");
if (min < 10) {
out.println("Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>Are you sure you want to delete this tee time?</p>");
out.println("<p align=\"center\">");
out.println("<input type=\"submit\" value=\"Yes - Delete It\" name=\"deleteSubmit\"></p>");
out.println("</font></td></tr></form></table>");
out.println("<br><br>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"submit\" value=\"No - Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"No - Return to Tee Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
//
// End of HTML page
//
out.println("</td></tr></table>"); // end of main page
out.println("</td></tr></table>"); // end of whole page
out.println("</center></body></html>");
out.close();
} else {
//
// Call is from self to process a delete request (final - this is the confirmation)
//
// Check to make sure a slot like this already exists
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"SELECT mm FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setLong(1, date);
pstmt1.setInt(2, time);
pstmt1.setInt(3, fb);
pstmt1.setString(4, course);
rs = pstmt1.executeQuery(); // execute the prepared stmt
if (!rs.next()) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Data Entry Error</H3>");
out.println("<BR><BR>A tee time with these date, time and F/B values does not exist.");
out.println("<BR><BR>Please try again.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
out.close();
return;
} // ok if we get here - matching time slot found
pstmt1.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
//
// This slot was found - delete it from the database
//
try {
PreparedStatement pstmt2 = con.prepareStatement (
"DELETE FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt2.clearParameters(); // clear the parms
pstmt2.setLong(1, date);
pstmt2.setInt(2, time);
pstmt2.setInt(3, fb);
pstmt2.setString(4, course);
int count = pstmt2.executeUpdate(); // execute the prepared stmt
pstmt2.close(); // close the stmt
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>" + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// Delete complete - inform user
//
sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
out.println("<HTML><HEAD><title>Proshop Delete Confirmation</title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +indexs+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&jump=" +jump+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center>");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("><BR><BR><H3>Delete Tee Time Confirmation</H3>");
out.println("<BR><BR>Thank you, the following tee time has been removed.");
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
if (min < 10) {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</center></BODY></HTML>");
out.close();
}
} // end of doDelete
// *********************************************************
// Process a delete request for a lottery
//
// Parms: lotteryId = uid for request to be deleted
//
// *********************************************************
private void doDeleteLottery(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
String sindex = req.getParameter("index"); // index value of the day
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String emailOpt = req.getParameter("email"); // get the email indicator
String lott_name = req.getParameter("lott_name");
String hide = req.getParameter("hide");
String slid = req.getParameter("lotteryId");
int index = 0;
int lottery_id = 0;
if (slid == null) slid = "";
//
// Convert the index value from string to int
//
try {
index = Integer.parseInt(sindex);
lottery_id = Integer.parseInt(slid);
}
catch (NumberFormatException e) { }
try {
PreparedStatement pstmt2 = con.prepareStatement (
"DELETE FROM lreqs3 WHERE id = ?");
pstmt2.clearParameters();
pstmt2.setInt(1, lottery_id);
pstmt2.executeUpdate();
pstmt2.close();
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>" + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
out.println("<HTML><HEAD><title>Proshop Delete Confirmation</title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +index+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&jump=" +jump+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center>");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<BR><BR><H3>Delete Lottery Request Confirmation</H3>");
out.println("<BR><BR>Thank you, the request has been removed.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + index + ">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
}
// *********************************************************
// Process insert request from above
//
// parms: index = index value for date
// course = name of course
// returnCourse = name of course for return to sheet
// jump = jump index for return
// time = time of tee time
// fb = f/b indicator
// insertSubmit = if from self
// first = if first tee time
//
// *********************************************************
private void doInsert(HttpServletRequest req, PrintWriter out, Connection con, HttpSession session) {
ResultSet rs = null;
//
// variables for this method
//
int year = 0;
int month = 0;
int day = 0;
int day_num = 0;
int hr = 0;
int min = 0;
int ampm = 0;
int fb = 0;
int time = 0;
int otime = 0;
int index = 0;
int event_type = 0;
int notify_id = 0;
String event = "";
String event_color = "";
String rest = "";
String rest2 = "";
String rest_color = "";
String rest_color2 = "";
String rest_recurr = "";
String rest5 = ""; // default values
String rest52 = "";
String rest5_color = "";
String rest5_color2 = "";
String rest5_recurr = "";
String lott = ""; // lottery name
String lott2 = ""; // lottery name
String lott_color = "";
String lott_color2 = "";
String lott_recurr = "";
String [] day_table = { "inv", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
//
// The 'index' paramter contains an index value
// (0 = today, 1 = tomorrow, etc.)
//
String indexs = req.getParameter("index"); // index value of the day
String course = req.getParameter("course"); // get the course name for this insert
String returnCourse = req.getParameter("returnCourse"); // get the course name for this sheet
String jump = req.getParameter("jump"); // get the jump index
String sfb = req.getParameter("fb");
String times = req.getParameter("time"); // get the tee time selected (hhmm)
String first = req.getParameter("first"); // get the first tee time indicator (yes or no)
String emailOpt = req.getParameter("email"); // get the email option from _sheet
String snid = req.getParameter("notifyId");
String hide = req.getParameter("hide");
String lott_name = req.getParameter("lott_name");
if (course == null) course = "";
if (snid == null) snid = "";
if (times == null) times = "";
if (sfb == null) sfb = "";
//
// Convert the index value from string to int
//
try {
time = Integer.parseInt(times);
index = Integer.parseInt(indexs);
fb = Integer.parseInt(sfb);
notify_id = Integer.parseInt(snid);
}
catch (NumberFormatException e) { }
//
// isolate hr and min values
//
hr = time / 100;
min = time - (hr * 100);
//
// Get today's date and then use the value passed to locate the requested date
//
Calendar cal = new GregorianCalendar(); // get todays date
cal.add(Calendar.DATE,index); // roll ahead (or back) 'index' days
year = cal.get(Calendar.YEAR);
month = cal.get(Calendar.MONTH) + 1;
day = cal.get(Calendar.DAY_OF_MONTH);
day_num = cal.get(Calendar.DAY_OF_WEEK); // day of week (01 - 07)
String day_name = day_table[day_num]; // get name for day
long date = year * 10000; // create a date field of yyyymmdd
date = date + (month * 100) + day; // date = yyyymmdd (for comparisons)
if (req.getParameter("insertSubmit") == null) { // if not an insert 'submit' request (from self)
//
// Process the initial call to Insert a New Tee Time
//
// Build the HTML page to prompt user for a specific time slot
//
out.println(SystemUtils.HeadTitle("Proshop Insert Tee Time Page"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#FFFFFF\" vlink=\"#FFFFFF\" alink=\"#FF0000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\"></font><center>");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // whole page
out.println("<tr><td align=\"center\" valign=\"top\">");
out.println("<table border=\"0\" align=\"center\" width=\"100%\">"); // main page
out.println("<tr><td align=\"center\">");
out.println("<img src=\"/" +rev+ "/images/foretees.gif\" border=0>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\" color=\"#000000\">");
out.println("<font size=\"5\">");
out.println("<p align=\"center\"><b>Insert Tee Sheet</b></p></font>");
out.println("<font size=\"2\">");
out.println("<table cellpadding=\"5\" align=\"center\" width=\"450\">");
out.println("<tr><td colspan=\"4\" bgcolor=\"#336633\"><font color=\"#FFFFFF\" size=\"2\">");
out.println("<b>Instructions:</b> To insert a tee time for the date shown below, select the time");
out.println(" and the 'front/back' values. Select 'Insert' to add the new tee time.");
out.println("</font></td></tr></table><br>");
out.println("<table border=\"2\" bgcolor=\"#F5F5DC\" cellpadding=\"8\" align=\"center\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"insert\" value=\"yes\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<tr><td width=\"450\">");
out.println("<font size=\"2\">");
out.println("<p align=\"left\">");
out.println("<b>Note:</b> This tee time must be unique from all others on the sheet. ");
out.println("Therefore, at least one of these values must be different than other tee times.");
out.println("<p align=\"center\">Date: <b>" + day_name + " " + month + "/" + day + "/" + year + "</b></p>");
out.println("Time: ");
out.println("<select size=\"1\" name=\"time\">");
//
// Define some variables for this processing
//
PreparedStatement pstmt1b = null;
String dampm = " AM";
int dhr = hr;
int i = 0;
int i2 = 0;
int mint = min;
int hrt = hr;
int last = 0;
int start = 0;
int maxtimes = 20;
//
// Determine time values to be used for selection
//
loopt:
while (i < maxtimes) {
mint++; // next minute
if (mint > 59) {
mint = 0; // rotate the hour
hrt++;
}
if (hrt > 23) {
hrt = 23;
mint = 59;
break loopt; // done
}
if (i == 0) { // if first time
start = (hrt * 100) + mint; // save first time for select
}
i++;
}
last = (hrt * 100) + mint; // last time for select
try {
//
// Find the next time - after the time selected - use as the limit for selection list
//
pstmt1b = con.prepareStatement (
"SELECT time FROM teecurr2 " +
"WHERE date = ? AND time > ? AND time < ? AND fb = ? AND courseName = ? " +
"ORDER BY time");
pstmt1b.clearParameters(); // clear the parms
pstmt1b.setLong(1, date);
pstmt1b.setInt(2, time);
pstmt1b.setInt(3, last);
pstmt1b.setInt(4, fb);
pstmt1b.setString(5, course);
rs = pstmt1b.executeQuery(); // execute the prepared stmt
if (rs.next()) {
last = rs.getInt(1); // get the first time found - use as upper limit for display
}
pstmt1b.close();
}
catch (Exception e) {
}
i = 0;
//
// If first tee time on sheet, then allow 20 tee times prior to this time.
//
if (first.equalsIgnoreCase( "yes" )) {
mint = min; // get original time
hrt = hr;
while (i < maxtimes) { // determine the first time
if (mint > 0) {
mint--;
} else { // assume not midnight
hrt--;
mint = 59;
}
i++;
}
start = (hrt * 100) + mint; // save first time for select
maxtimes = 40; // new max for this request
}
//
// Start with the time selected in case they want a tee time with same time, different f/b
//
if (dhr > 11) {
dampm = " PM";
}
if (dhr > 12) {
dhr = dhr - 12;
}
if (min < 10) {
out.println("<option value=\"" +time+ "\">" +dhr+ ":0" +min+ " " +dampm+ "</option>");
} else {
out.println("<option value=\"" +time+ "\">" +dhr+ ":" +min+ " " +dampm+ "</option>");
}
//
// list tee times that follow the one selected, but less than 'last'
//
otime = time; // save original time value
i = 0;
hr = start / 100; // get values for start time (first in select list)
min = start - (hr * 100);
loop1:
while (i < maxtimes) {
dhr = hr; // init as same
dampm = " AM";
if (hr == 0) {
dhr = 12;
}
if (hr > 12) {
dampm = " PM";
dhr = hr - 12;
}
if (hr == 12) {
dampm = " PM";
}
time = (hr * 100) + min; // set time value
if (time >= last) { // if we reached the end
break loop1; // done
}
if (time != otime) { // if not same as original time
if (min < 10) {
out.println("<option value=\"" +time+ "\">" +dhr+ ":0" +min+ " " +dampm+ "</option>");
} else {
out.println("<option value=\"" +time+ "\">" +dhr+ ":" +min+ " " +dampm+ "</option>");
}
}
min++; // next minute
if (min > 59) {
min = 0; // rotate the hour
hr++;
}
if (hr > 23) {
break loop1; // done
}
i++;
} // end of while
out.println("</select>");
out.println(" ");
out.println("Front/Back: ");
out.println("<select size=\"1\" name=\"fb\">");
out.println("<option value=\"00\">Front</option>");
out.println("<option value=\"01\">Back</option>");
out.println("<option value=\"09\">Crossover</option>");
out.println("</select>");
out.println("<br><br></p>");
out.println("<p align=\"center\">");
out.println("<input type=\"submit\" value=\"Insert\" name=\"insertSubmit\"></p>");
out.println("</font></td></tr></form></table>");
out.println("<br><br>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" +hide+ "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" +lott_name+ "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
//
// End of HTML page
//
out.println("</td></tr></table>"); // end of main page
out.println("</td></tr></table>"); // end of whole page
out.println("</center></body></html>");
out.close();
} else { // end of Insert Submit processing
//
// Call is from self to process an insert request (submit)
//
// Parms passed: time = time of the tee time to be inserted
// date = date of the tee sheet
// fb = the front/back value (see above)
// course = course name
// returnCourse = course name for return
//
// Check to make sure a slot like this doesn't already exist
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"SELECT mm FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setLong(1, date);
pstmt1.setInt(2, time);
pstmt1.setInt(3, fb);
pstmt1.setString(4, course);
rs = pstmt1.executeQuery(); // execute the prepared stmt
if (rs.next()) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Data Entry Error</H3>");
out.println("<BR><BR>A tee time with these date, time and F/B values already exists.");
out.println("<BR>One of these values must change so the tee time is unique.");
out.println("<BR><BR>Please try again.");
out.println("<BR><BR>");
out.println("<a href=\"javascript:history.back(1)\">Return</a>");
out.println("</center></BODY></HTML>");
return;
} // ok if we get here - not matching time slot
pstmt1.close(); // close the stmt
}
catch (Exception ignore) { // this is good if no match found
}
//
// This slot is unique - now check for events or restrictions for this date and time
//
try {
SystemUtils.insertTee(date, time, fb, course, day_name, con); // insert new tee time
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, contact customer support.");
out.println("<BR><BR>Error in Proshop_dlott: " + e1.getMessage());
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + index + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</center></BODY></HTML>");
out.close();
return;
}
//
// Insert complete - inform user
//
String sampm = "AM";
if (hr > 11) { // if PM
sampm = "PM";
}
out.println("<HTML><HEAD><Title>Proshop Insert Confirmation</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"1; url=/" +rev+ "/servlet/Proshop_dlott?index=" +indexs+ "&course=" +returnCourse+ "&jump=" +jump+ "&email=" +emailOpt+ "&hide=" +hide+ "&lott_name=" +lott_name+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<center><BR><BR><H3>Insert Tee Time Confirmation</H3>");
out.println("<BR><BR>Thank you, the following tee time has been added.");
if (hr > 12) {
hr = hr - 12; // convert back to conventional time
}
if (min < 10) {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":0" + min + " " + sampm + "</b>");
} else {
out.println("<BR><BR>Date & Time: <b>" + day_name + " " + month + "/" + day + "/" + year + " " + hr + ":" + min + " " + sampm + "</b>");
}
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + indexs + ">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + jump + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + lott_name + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" +emailOpt+ "\">");
out.println("<input type=\"submit\" value=\"Continue\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</center></BODY></HTML>");
//
// Refresh the blockers in case the tee time added is covered by a blocker
//
SystemUtils.doBlockers(con);
out.close();
}
} // end of doInsert
// *********************************************************
// changeCW - change the C/W option for 1 or all players in tee time.
//
// parms:
// jump = jump index for return
// from_player = player position being changed (1-5)
// from_time = tee time being changed
// from_fb = f/b of tee time
// from_course = name of course
// to_from = current C/W option
// to_to = new C/W option
// changeAll = change all players in slot (true or false)
// ninehole = use 9 Hole options (true or false)
//
// *********************************************************
private void changeCW(parmSlot slotParms, String changeAll, String ninehole, long date, HttpServletRequest req, PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String newcw = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.changeCW - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use
//
try {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
catch (Exception e1) {
String eMsg = "Error 1 in changeCW. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req);
return;
}
//
// Ok - get current player info from the parm block (set by checkInUse)
//
player1 = slotParms.player1;
player2 = slotParms.player2;
player3 = slotParms.player3;
player4 = slotParms.player4;
player5 = slotParms.player5;
p1cw = slotParms.p1cw;
p2cw = slotParms.p2cw;
p3cw = slotParms.p3cw;
p4cw = slotParms.p4cw;
p5cw = slotParms.p5cw;
p91 = slotParms.p91;
p92 = slotParms.p92;
p93 = slotParms.p93;
p94 = slotParms.p94;
p95 = slotParms.p95;
//
// If '9 Hole' option selected, then change new C/W to 9 hole type
//
newcw = slotParms.to_to; // get selected C/W option
//
// Set the new C/W value for each player requested
//
if (!player1.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 1)) { // change this one?
p1cw = newcw;
if (ninehole.equals( "true" )) {
p91 = 1; // make it a 9 hole type
} else {
p91 = 0; // make it 18 hole
}
}
}
if (!player2.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 2)) { // change this one?
p2cw = newcw;
if (ninehole.equals( "true" )) {
p92 = 1; // make it a 9 hole type
} else {
p92 = 0; // make it 18 hole
}
}
}
if (!player3.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 3)) { // change this one?
p3cw = newcw;
if (ninehole.equals( "true" )) {
p93 = 1; // make it a 9 hole type
} else {
p93 = 0; // make it 18 hole
}
}
}
if (!player4.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 4)) { // change this one?
p4cw = newcw;
if (ninehole.equals( "true" )) {
p94 = 1; // make it a 9 hole type
} else {
p94 = 0; // make it 18 hole
}
}
}
if (!player5.equals( "" )) {
if ((changeAll.equals( "true" )) || (slotParms.from_player == 5)) { // change this one?
p5cw = newcw;
if (ninehole.equals( "true" )) {
p95 = 1; // make it a 9 hole type
} else {
p95 = 0; // make it 18 hole
}
}
}
//
// Update the tee time and set it no longer in use
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET " +
"p1cw=?, p2cw=?, p3cw=?, p4cw=?, in_use=0, p5cw=?, p91=?, p92=?, p93=?, p94=?, p95=? " +
"WHERE date=? AND time=? AND fb=? AND courseName=?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setString(1, p1cw);
pstmt1.setString(2, p2cw);
pstmt1.setString(3, p3cw);
pstmt1.setString(4, p4cw);
pstmt1.setString(5, p5cw);
pstmt1.setInt(6, p91);
pstmt1.setInt(7, p92);
pstmt1.setInt(8, p93);
pstmt1.setInt(9, p94);
pstmt1.setInt(10, p95);
pstmt1.setLong(11, date);
pstmt1.setInt(12, slotParms.from_time);
pstmt1.setInt(13, slotParms.from_fb);
pstmt1.setString(14, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception e1) {
String eMsg = "Error 2 in changeCW. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
} // end of changeCW
// *********************************************************
// changeFB - change the F/B option for the tee time specified.
//
// parms:
// jump = jump index for return
// from_time = tee time being changed
// from_fb = current f/b of tee time
// from_course = name of course
// to_fb = new f/b of tee time
//
// *********************************************************
private void changeFB(parmSlot slotParms, long date, HttpServletRequest req, PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.changeFB - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use
//
try {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
catch (Exception e1) {
String eMsg = "Error 1 in changeFB. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req);
return;
}
//
// Ok, tee time not busy - change the F/B
//
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = 0, fb = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, slotParms.to_fb);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception e1) {
String eMsg = "Error 2 in changeFB. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
} // end of changeFB
// *********************************************************
// moveWhole - move an entire tee time
//
// parms:
// jump = jump index for return
// from_time = tee time being moved
// from_fb = f/b of tee time being moved
// from_course = name of course of tee time being moved
// to_time = tee time to move to
// to_fb = f/b of tee time to move to
// to_course = name of course of tee time to move to
//
// prompt = null if first call here
// = 'return' if user wants to return w/o changes
// = 'continue' if user wants to continue with changes
// skip = verification process to skip if 2nd return
//
// *********************************************************
private void moveWhole(parmSlot slotParms, long date, String prompt, int skip, HttpServletRequest req,
PrintWriter out, Connection con, HttpServletResponse resp) {
ResultSet rs = null;
int in_use = 0;
String hideUnavail = req.getParameter("hide");
String p1 = "";
String p2 = "";
String p3 = "";
String p4 = "";
String p5 = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String mNum1 = "";
String mNum2 = "";
String mNum3 = "";
String mNum4 = "";
String mNum5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String orig_by = "";
String conf = "";
String notes = "";
short pos1 = 0;
short pos2 = 0;
short pos3 = 0;
short pos4 = 0;
short pos5 = 0;
short show1 = 0;
short show2 = 0;
short show3 = 0;
short show4 = 0;
short show5 = 0;
int hide = 0;
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
int fives = 0;
int sendemail = 0;
float hndcp1 = 0;
float hndcp2 = 0;
float hndcp3 = 0;
float hndcp4 = 0;
float hndcp5 = 0;
boolean error = false;
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveWhole - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use (the FROM tee time)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, then tee time is already busy
in_use = 0;
getTeeTimeData(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 1 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req); // reject as busy
return;
}
//
// Ok - get current 'FROM' player info from the parm block (set by checkInUse) and save it
//
player1 = slotParms.player1;
player2 = slotParms.player2;
player3 = slotParms.player3;
player4 = slotParms.player4;
player5 = slotParms.player5;
p1cw = slotParms.p1cw;
p2cw = slotParms.p2cw;
p3cw = slotParms.p3cw;
p4cw = slotParms.p4cw;
p5cw = slotParms.p5cw;
user1 = slotParms.user1;
user2 = slotParms.user2;
user3 = slotParms.user3;
user4 = slotParms.user4;
user5 = slotParms.user5;
hndcp1 = slotParms.hndcp1;
hndcp2 = slotParms.hndcp2;
hndcp3 = slotParms.hndcp3;
hndcp4 = slotParms.hndcp4;
hndcp5 = slotParms.hndcp5;
show1 = slotParms.show1;
show2 = slotParms.show2;
show3 = slotParms.show3;
show4 = slotParms.show4;
show5 = slotParms.show5;
pos1 = slotParms.pos1;
pos2 = slotParms.pos2;
pos3 = slotParms.pos3;
pos4 = slotParms.pos4;
pos5 = slotParms.pos5;
mNum1 = slotParms.mNum1;
mNum2 = slotParms.mNum2;
mNum3 = slotParms.mNum3;
mNum4 = slotParms.mNum4;
mNum5 = slotParms.mNum5;
userg1 = slotParms.userg1;
userg2 = slotParms.userg2;
userg3 = slotParms.userg3;
userg4 = slotParms.userg4;
userg5 = slotParms.userg5;
notes = slotParms.notes;
hide = slotParms.hide;
orig_by = slotParms.orig_by;
conf = slotParms.conf;
p91 = slotParms.p91;
p92 = slotParms.p92;
p93 = slotParms.p93;
p94 = slotParms.p94;
p95 = slotParms.p95;
slotParms.player1 = ""; // init parmSlot player fields (verifySlot will fill)
slotParms.player2 = "";
slotParms.player3 = "";
slotParms.player4 = "";
slotParms.player5 = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.to_time == 0 || slotParms.to_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveWhole2 - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.to_time+ ", course= " +slotParms.to_course+ ", fb= " +slotParms.to_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Now check if the 'TO' tee time is currently in use (this will put its info in slotParms)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 2 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
//
// If 'TO' tee time is in use
//
if (in_use != 0) {
//
// Error - We must free up the 'FROM' tee time
//
in_use = 0;
try {
PreparedStatement pstmt4 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt4.clearParameters(); // clear the parms
pstmt4.setInt(1, in_use);
pstmt4.setLong(2, date);
pstmt4.setInt(3, slotParms.from_time);
pstmt4.setInt(4, slotParms.from_fb);
pstmt4.setString(5, slotParms.from_course);
pstmt4.executeUpdate(); // execute the prepared stmt
pstmt4.close();
}
catch (Exception ignore) {
}
teeBusy(out, slotParms, req);
return;
}
//
// If user was prompted and opted to return w/o changes, then we must clear the 'in_use' flags
// before returning to the tee sheet.
//
if (prompt.equals( "return" )) { // if prompt specified a return
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters();
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
// return to Proshop_dlott
out.println("<HTML><HEAD><Title>Proshop Edit Lottery Complete</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&email=" + slotParms.sendEmail + "&jump=" + slotParms.jump + "&lott_name=" +slotParms.lottery+ "&hide=" +hideUnavail+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<BR><BR><H2>Return Accepted</H2>");
out.println("<BR><BR>Thank you, click Return' below if this does not automatically return.<BR>");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} else { // not a 'return' response from prompt
//
// This is either the first time here, or a 'Continue' reply to a prompt
//
//
p1 = slotParms.player1; // get players' names for easier reference
p2 = slotParms.player2;
p3 = slotParms.player3;
p4 = slotParms.player4;
p5 = slotParms.player5;
//
// If any skips are set, then we've already been through here.
//
if (skip == 0) {
//
// Check if 'TO' tee time is empty
//
if (!p1.equals( "" ) || !p2.equals( "" ) || !p3.equals( "" ) || !p4.equals( "" ) || !p5.equals( "" )) {
//
// Tee time is occupied - inform user and ask to continue or cancel
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Tee Time is Occupied</H3><BR>");
out.println("<BR>WARNING: The tee time you are trying to move TO is already occupied.");
out.println("<BR><BR>If you continue, this tee time will effectively be cancelled.");
out.println("<BR><BR>Would you like to continue and overwrite this tee time?");
out.println("<BR><BR>");
out.println("<BR><BR>Course = " +slotParms.to_course+ ", p1= " +p1+ ", p2= " +p2+ ", p3= " +p3+ ", p4= " +p4+ ", p5= " +p5+ ".");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"1\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 2) {
//
// *******************************************************************************
// Check member restrictions in 'TO' tee time, but 'FROM' players
//
// First, find all restrictions within date & time constraints on this course.
// Then, find the ones for this day.
// Then, find any for this member type or membership type (all 5 players).
//
// *******************************************************************************
//
//
// allocate and setup new parm block to hold the tee time parms for this process
//
parmSlot slotParms2 = new parmSlot(); // allocate a parm block
slotParms2.date = date; // get 'TO' info
slotParms2.time = slotParms.to_time;
slotParms2.course = slotParms.to_course;
slotParms2.fb = slotParms.to_fb;
slotParms2.day = slotParms.day;
slotParms2.player1 = player1; // get 'FROM' info
slotParms2.player2 = player2;
slotParms2.player3 = player3;
slotParms2.player4 = player4;
slotParms2.player5 = player5;
try {
verifySlot.parseGuests(slotParms2, con); // check for guests and set guest types
error = verifySlot.parseNames(slotParms2, "pro"); // get the names (lname, fname, mi)
verifySlot.getUsers(slotParms2, con); // get the mship and mtype info (needs lname, fname, mi)
error = false; // init error indicator
error = verifySlot.checkMemRests(slotParms2, con); // check restrictions
}
catch (Exception ignore) {
}
if (error == true) { // if we hit on a restriction
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>" + slotParms2.player + "</b> is restricted from playing during this time.<br><br>");
out.println("This time slot has the following restriction: <b>" + slotParms2.rest_name + "</b><br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"2\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 3) {
//
// *******************************************************************************
// Check 5-some restrictions - use 'FROM' player5 and 'TO' tee time slot
//
// If 5-somes are restricted during this tee time, warn the proshop user.
// *******************************************************************************
//
if ((!player5.equals( "" )) && (!slotParms.rest5.equals( "" ))) { // if 5-somes restricted prompt user to skip test
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are restricted during this time.<br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"3\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 4) {
//
// *******************************************************************************
// Check 5-somes allowed on 'to course' and from-player5 specified
// *******************************************************************************
//
if (!player5.equals( "" )) { // if player5 exists in 'from' slot
fives = 0;
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 WHERE courseName = ?");
pstmtc.clearParameters(); // clear the parms
pstmtc.setString(1, slotParms.to_course);
rs = pstmtc.executeQuery(); // execute the prepared stmt
if (rs.next()) {
fives = rs.getInt("fives");
}
pstmtc.close();
}
catch (Exception e) {
}
if (fives == 0) { // if 5-somes not allowed on to_course
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Tee Sheet - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>5-Somes Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are not allowed on the course player5 is being moved to.");
out.println("<BR>Player5 will be lost if you continue.<br><br>");
out.println("<BR><BR>Would you like to move this tee time without player5?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"day\" value=\"" + slotParms.day + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hideUnavail + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"4\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
}
} // end of IF 'return' reply from prompt
//
// If we get here, then the move is OK
//
// - move 'FROM' tee time info into this one (TO)
//
if (skip == 4) { // if player5 being moved to course that does not allow 5-somes
player5 = "";
user5 = "";
userg5 = "";
}
in_use = 0;
//
// Make sure we have the players and other info (this has failed before!!!)
//
if (!player1.equals( "" ) || !player2.equals( "" ) || !player3.equals( "" ) || !player4.equals( "" ) || !player5.equals( "" )) {
try {
PreparedStatement pstmt6 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = ?, player2 = ?, player3 = ?, player4 = ?, " +
"username1 = ?, username2 = ?, username3 = ?, username4 = ?, p1cw = ?, " +
"p2cw = ?, p3cw = ?, p4cw = ?, in_use = ?, hndcp1 = ?, hndcp2 = ?, hndcp3 = ?, " +
"hndcp4 = ?, show1 = ?, show2 = ?, show3 = ?, show4 = ?, player5 = ?, username5 = ?, " +
"p5cw = ?, hndcp5 = ?, show5 = ?, notes = ?, hideNotes = ?, " +
"mNum1 = ?, mNum2 = ?, mNum3 = ?, mNum4 = ?, mNum5 = ?, " +
"userg1 = ?, userg2 = ?, userg3 = ?, userg4 = ?, userg5 = ?, orig_by = ?, conf = ?, " +
"p91 = ?, p92 = ?, p93 = ?, p94 = ?, p95 = ?, pos1 = ?, pos2 = ?, pos3 = ?, pos4 = ?, pos5 = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, player1);
pstmt6.setString(2, player2);
pstmt6.setString(3, player3);
pstmt6.setString(4, player4);
pstmt6.setString(5, user1);
pstmt6.setString(6, user2);
pstmt6.setString(7, user3);
pstmt6.setString(8, user4);
pstmt6.setString(9, p1cw);
pstmt6.setString(10, p2cw);
pstmt6.setString(11, p3cw);
pstmt6.setString(12, p4cw);
pstmt6.setInt(13, in_use); // set in_use to NOT
pstmt6.setFloat(14, hndcp1);
pstmt6.setFloat(15, hndcp2);
pstmt6.setFloat(16, hndcp3);
pstmt6.setFloat(17, hndcp4);
pstmt6.setShort(18, show1);
pstmt6.setShort(19, show2);
pstmt6.setShort(20, show3);
pstmt6.setShort(21, show4);
pstmt6.setString(22, player5);
pstmt6.setString(23, user5);
pstmt6.setString(24, p5cw);
pstmt6.setFloat(25, hndcp5);
pstmt6.setShort(26, show5);
pstmt6.setString(27, notes);
pstmt6.setInt(28, hide);
pstmt6.setString(29, mNum1);
pstmt6.setString(30, mNum2);
pstmt6.setString(31, mNum3);
pstmt6.setString(32, mNum4);
pstmt6.setString(33, mNum5);
pstmt6.setString(34, userg1);
pstmt6.setString(35, userg2);
pstmt6.setString(36, userg3);
pstmt6.setString(37, userg4);
pstmt6.setString(38, userg5);
pstmt6.setString(39, orig_by);
pstmt6.setString(40, conf);
pstmt6.setInt(41, p91);
pstmt6.setInt(42, p92);
pstmt6.setInt(43, p93);
pstmt6.setInt(44, p94);
pstmt6.setInt(45, p95);
pstmt6.setShort(46, pos1);
pstmt6.setShort(47, pos2);
pstmt6.setShort(48, pos3);
pstmt6.setShort(49, pos4);
pstmt6.setShort(50, pos5);
pstmt6.setLong(51, date);
pstmt6.setInt(52, slotParms.to_time);
pstmt6.setInt(53, slotParms.to_fb);
pstmt6.setString(54, slotParms.to_course);
pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
}
catch (Exception e1) {
String eMsg = "Error 3 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Track the history of this tee time - make entry in 'teehist' table (check if new or update)
//
String fullName = "Edit Tsheet Moved From " + slotParms.from_time;
// new tee time
SystemUtils.updateHist(date, slotParms.day, slotParms.to_time, slotParms.to_fb, slotParms.to_course, player1, player2, player3,
player4, player5, slotParms.user, fullName, 0, con);
//
// Finally, set the 'FROM' tee time to NOT in use and clear out the players
//
try {
PreparedStatement pstmt5 = con.prepareStatement (
"UPDATE teecurr2 SET player1 = '', player2 = '', player3 = '', player4 = '', " +
"username1 = '', username2 = '', username3 = '', username4 = '', " +
"in_use = 0, show1 = 0, show2 = 0, show3 = 0, show4 = 0, " +
"player5 = '', username5 = '', show5 = 0, " +
"notes = '', " +
"mNum1 = '', mNum2 = '', mNum3 = '', mNum4 = '', mNum5 = '', " +
"userg1 = '', userg2 = '', userg3 = '', userg4 = '', userg5 = '', orig_by = '', conf = '', " +
"pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0, pos5 = 0 " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt5.clearParameters(); // clear the parms
pstmt5.setLong(1, date);
pstmt5.setInt(2, slotParms.from_time);
pstmt5.setInt(3, slotParms.from_fb);
pstmt5.setString(4, slotParms.from_course);
pstmt5.executeUpdate(); // execute the prepared stmt
pstmt5.close();
if (slotParms.sendEmail.equalsIgnoreCase( "yes" )) { // if ok to send emails
sendemail = 1; // tee time moved - send email notification
}
}
catch (Exception e1) {
String eMsg = "Error 4 in moveWhole. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Track the history of this tee time - make entry in 'teehist' table (check if new or update)
//
String empty = "";
fullName = "Edit Tsheet Move To " + slotParms.to_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.from_time, slotParms.from_fb, slotParms.from_course, empty, empty, empty,
empty, empty, slotParms.user, fullName, 1, con);
} else {
//
// save message in error log
//
String msg = "Error in Proshop_dlott.moveWhole - Player names lost " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
teeBusy(out, slotParms, req); // pretend its busy
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
try {
resp.flushBuffer(); // force the repsonse to complete
}
catch (Exception ignore) {
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
if (sendemail != 0) {
//
// allocate a parm block to hold the email parms
//
parmEmail parme = new parmEmail(); // allocate an Email parm block
//
// Set the values in the email parm block
//
parme.type = "moveWhole"; // type = Move Whole tee time
parme.date = date;
parme.time = 0;
parme.to_time = slotParms.to_time;
parme.from_time = slotParms.from_time;
parme.fb = 0;
parme.to_fb = slotParms.to_fb;
parme.from_fb = slotParms.from_fb;
parme.to_course = slotParms.to_course;
parme.from_course = slotParms.from_course;
parme.mm = slotParms.mm;
parme.dd = slotParms.dd;
parme.yy = slotParms.yy;
parme.user = slotParms.user;
parme.emailNew = 0;
parme.emailMod = 0;
parme.emailCan = 0;
parme.p91 = p91;
parme.p92 = p92;
parme.p93 = p93;
parme.p94 = p94;
parme.p95 = p95;
parme.day = slotParms.day;
parme.player1 = player1;
parme.player2 = player2;
parme.player3 = player3;
parme.player4 = player4;
parme.player5 = player5;
parme.user1 = user1;
parme.user2 = user2;
parme.user3 = user3;
parme.user4 = user4;
parme.user5 = user5;
parme.pcw1 = p1cw;
parme.pcw2 = p2cw;
parme.pcw3 = p3cw;
parme.pcw4 = p4cw;
parme.pcw5 = p5cw;
//
// Send the email
//
sendEmail.sendIt(parme, con); // in common
} // end of IF sendemail
} // end of moveWhole
// *********************************************************
// moveSingle - move a single player
//
// parms:
// jump = jump index for return
// from_player = player position being moved (1-5)
// from_time = tee time being moved
// from_fb = f/b of tee time being moved
// from_course = name of course
// to_player = player position to move to (1-5)
// to_time = tee time to move to
// to_fb = f/b of tee time to move to
// to_course = name of course
//
// prompt = null if first call here
// = 'return' if user wants to return w/o changes
// = 'continue' if user wants to continue with changes
// skip = verification process to skip if 2nd return
//
// *********************************************************
private void moveSingle(parmSlot slotParms, long date, String prompt, int skip, HttpServletRequest req,
PrintWriter out, Connection con, HttpServletResponse resp) {
PreparedStatement pstmt6 = null;
ResultSet rs = null;
int fives = 0;
int in_use = 0;
int from = slotParms.from_player; // get the player positions (1-5)
int fr = from; // save original value
int to = slotParms.to_player;
int sendemail = 0;
//
// arrays to hold the player info (FROM tee time)
//
String [] p = new String [5];
String [] player = new String [5];
String [] pcw = new String [5];
String [] user = new String [5];
String [] mNum = new String [5];
String [] userg = new String [5];
short [] show = new short [5];
short [] pos = new short [5];
float [] hndcp = new float [5];
int [] p9 = new int [5];
boolean error = false;
String fullName = "Proshop Edit Lottery"; // for tee time history
String hide = req.getParameter("hide");
//
// adjust the player positions so they can be used for array indexes
//
if (to > 0 && to < 6) {
to--;
} else {
to = 1; // prevent big problem
}
if (from > 0 && from < 6) {
from--;
} else {
from = 1; // prevent big problem
}
//
// Verify the required parms exist
//
if (date == 0 || slotParms.from_time == 0 || slotParms.from_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveSingle - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.from_time+ ", course= " +slotParms.from_course+ ", fb= " +slotParms.from_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Check if the requested tee time is currently in use (the FROM tee time)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.from_time, slotParms.from_fb, slotParms.from_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 1 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
if (in_use != 0) { // if time slot already in use
teeBusy(out, slotParms, req); // first call here - reject as busy
return;
}
//
// Ok - get current 'FROM' player info from the parm block (set by checkInUse) and save it
//
player[0] = slotParms.player1;
player[1] = slotParms.player2;
player[2] = slotParms.player3;
player[3] = slotParms.player4;
player[4] = slotParms.player5;
pcw[0] = slotParms.p1cw;
pcw[1] = slotParms.p2cw;
pcw[2] = slotParms.p3cw;
pcw[3] = slotParms.p4cw;
pcw[4] = slotParms.p5cw;
user[0] = slotParms.user1;
user[1] = slotParms.user2;
user[2] = slotParms.user3;
user[3] = slotParms.user4;
user[4] = slotParms.user5;
hndcp[0] = slotParms.hndcp1;
hndcp[1] = slotParms.hndcp2;
hndcp[2] = slotParms.hndcp3;
hndcp[3] = slotParms.hndcp4;
hndcp[4] = slotParms.hndcp5;
show[0] = slotParms.show1;
show[1] = slotParms.show2;
show[2] = slotParms.show3;
show[3] = slotParms.show4;
show[4] = slotParms.show5;
mNum[0] = slotParms.mNum1;
mNum[1] = slotParms.mNum2;
mNum[2] = slotParms.mNum3;
mNum[3] = slotParms.mNum4;
mNum[4] = slotParms.mNum5;
userg[0] = slotParms.userg1;
userg[1] = slotParms.userg2;
userg[2] = slotParms.userg3;
userg[3] = slotParms.userg4;
userg[4] = slotParms.userg5;
p9[0] = slotParms.p91;
p9[1] = slotParms.p92;
p9[2] = slotParms.p93;
p9[3] = slotParms.p94;
p9[4] = slotParms.p95;
pos[0] = slotParms.pos1;
pos[1] = slotParms.pos2;
pos[2] = slotParms.pos3;
pos[3] = slotParms.pos4;
pos[4] = slotParms.pos5;
slotParms.player1 = ""; // init parmSlot player fields (verifySlot will fill)
slotParms.player2 = "";
slotParms.player3 = "";
slotParms.player4 = "";
slotParms.player5 = "";
//
// Verify the required parms exist
//
if (date == 0 || slotParms.to_time == 0 || slotParms.to_course == null || slotParms.user.equals( "" ) || slotParms.user == null) {
//
// save message in /" +rev+ "/error.txt
//
String msg = "Error in Proshop_dlott.moveSingle2 - checkInUse Parms - for user " +slotParms.user+ " at " +slotParms.club+ ". Date= " +date+ ", time= " +slotParms.to_time+ ", course= " +slotParms.to_course+ ", fb= " +slotParms.to_fb; // build msg
SystemUtils.logError(msg); // log it
in_use = 1; // make like the time is busy
} else { // continue if parms ok
//
// Now check if the 'TO' tee time is currently in use (this will put its info in slotParms)
//
try {
//
// If we got here by returning from a prompt below, then tee time is already busy
//
if (!prompt.equals( "" )) { // if return, tee time already busy
in_use = 0;
getTeeTimeData(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms, con);
} else {
in_use = verifySlot.checkInUse(date, slotParms.to_time, slotParms.to_fb, slotParms.to_course, slotParms.user, slotParms, con);
}
}
catch (Exception e1) {
String eMsg = "Error 2 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
}
//
// If 'TO' tee time is in use
//
if (in_use != 0) {
//
// Error - We must free up the 'FROM' tee time
//
try {
PreparedStatement pstmt4 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = 0 " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt4.clearParameters(); // clear the parms
pstmt4.setLong(1, date);
pstmt4.setInt(2, slotParms.from_time);
pstmt4.setInt(3, slotParms.from_fb);
pstmt4.setString(4, slotParms.from_course);
pstmt4.executeUpdate(); // execute the prepared stmt
pstmt4.close();
}
catch (Exception ignore) {
}
teeBusy(out, slotParms, req);
return;
}
//
// If user was prompted and opted to return w/o changes, then we must clear the 'in_use' flags
// before returning to the tee sheet.
//
if (prompt.equals( "return" )) { // if prompt specified a return
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
// return to Proshop_dlott
out.println("<HTML><HEAD><Title>Proshop Edit Lottery Complete</Title>");
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=/" +rev+ "/servlet/Proshop_dlott?index=" + slotParms.ind + "&course=" + slotParms.returnCourse + "&email=" + slotParms.sendEmail + "&jump=" + slotParms.jump + "&hide=" +hide+ "&lott_name=" +slotParms.lottery+ "\">");
out.println("</HEAD>");
out.println("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR>");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<BR><BR><H2>Return Accepted</H2>");
out.println("<BR><BR>Thank you, click Return' below if this does not automatically return.<BR>");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Return\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
} else { // not a 'return' response from prompt
//
// This is either the first time here, or a 'Continue' reply to a prompt
//
p[0] = slotParms.player1; // save 'TO' player names
p[1] = slotParms.player2;
p[2] = slotParms.player3;
p[3] = slotParms.player4;
p[4] = slotParms.player5;
//
// Make sure there are no duplicate names
//
if (!user[from].equals( "" )) { // if player is a member
if ((player[from].equalsIgnoreCase( p[0] )) || (player[from].equalsIgnoreCase( p[1] )) ||
(player[from].equalsIgnoreCase( p[2] )) || (player[from].equalsIgnoreCase( p[3] )) ||
(player[from].equalsIgnoreCase( p[4] ))) {
//
// Error - name already exists
//
in_use = 0;
try {
PreparedStatement pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.from_time);
pstmt1.setInt(4, slotParms.from_fb);
pstmt1.setString(5, slotParms.from_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
pstmt1 = con.prepareStatement (
"UPDATE teecurr2 SET in_use = ? " +
"WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt1.clearParameters(); // clear the parms
pstmt1.setInt(1, in_use);
pstmt1.setLong(2, date);
pstmt1.setInt(3, slotParms.to_time);
pstmt1.setInt(4, slotParms.to_fb);
pstmt1.setString(5, slotParms.to_course);
pstmt1.executeUpdate(); // execute the prepared stmt
pstmt1.close();
}
catch (Exception ignore) {
}
out.println(SystemUtils.HeadTitle("Player Move Error"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Player Move Error</H3>");
out.println("<BR><BR>Sorry, but the selected player is already scheduled at the time you are moving to.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Back to Edit\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// If any skips are set, then we've already been through here.
//
if (skip == 0) {
//
// Check if 'TO' tee time position is empty
//
if (!p[to].equals( "" )) {
//
// Tee time is occupied - inform user and ask to continue or cancel
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Tee Time Position is Occupied</H3><BR>");
out.println("<BR>WARNING: The tee time position you are trying to move TO is already occupied.");
out.println("<BR><BR>If you continue, the current player in this position (" +p[to]+ ") will be replaced.");
out.println("<BR><BR>Would you like to continue and replace this player?");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"1\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
//
// *******************************************************************************
// Check 5-somes allowed on 'to course' if moving to player5 slot
// *******************************************************************************
//
if (to == 4) { // if player being moved to player5 slot
fives = 0;
try {
PreparedStatement pstmtc = con.prepareStatement (
"SELECT fives " +
"FROM clubparm2 WHERE courseName = ?");
pstmtc.clearParameters(); // clear the parms
pstmtc.setString(1, slotParms.to_course);
rs = pstmtc.executeQuery(); // execute the prepared stmt
if (rs.next()) {
fives = rs.getInt("fives");
}
pstmtc.close();
}
catch (Exception e) {
}
if (fives == 0) { // if 5-somes not allowed on to_course
out.println(SystemUtils.HeadTitle("Player Move Error"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Player Move Error</H3>");
out.println("<BR><BR>Sorry, but the course you are moving the player to does not support 5-somes.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
}
//
// check if we are to skip this test
//
if (skip < 2) {
//
// *******************************************************************************
// Check member restrictions in 'TO' tee time, but 'FROM' players
//
// First, find all restrictions within date & time constraints on this course.
// Then, find the ones for this day.
// Then, find any for this member type or membership type (all 5 players).
//
// *******************************************************************************
//
//
// allocate and setup new parm block to hold the tee time parms for this process
//
parmSlot slotParms2 = new parmSlot(); // allocate a parm block
slotParms2.date = date; // get 'TO' info
slotParms2.time = slotParms.to_time;
slotParms2.course = slotParms.to_course;
slotParms2.fb = slotParms.to_fb;
slotParms2.day = slotParms.day;
slotParms2.player1 = player[from]; // get 'FROM' player (only check this player)
try {
verifySlot.parseGuests(slotParms2, con); // check for guest and set guest type
error = verifySlot.parseNames(slotParms2, "pro"); // get the name (lname, fname, mi)
verifySlot.getUsers(slotParms2, con); // get the mship and mtype info (needs lname, fname, mi)
error = false; // init error indicator
error = verifySlot.checkMemRests(slotParms2, con); // check restrictions
}
catch (Exception ignore) {
}
if (error == true) { // if we hit on a restriction
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>" +player[from]+ "</b> is restricted from playing during this time.<br><br>");
out.println("This time slot has the following restriction: <b>" + slotParms2.rest_name + "</b><br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"2\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
//
// check if we are to skip this test
//
if (skip < 3) {
//
// *******************************************************************************
// Check 5-some restrictions - use 'FROM' player5 and 'TO' tee time slot
//
// If moving to position 5 & 5-somes are restricted during this tee time, warn the proshop user.
// *******************************************************************************
//
if ((to == 4) && (!slotParms.rest5.equals( "" ))) { // if 5-somes restricted prompt user to skip test
//
// Prompt user to see if he wants to override this violation
//
out.println(SystemUtils.HeadTitle("Edit Lottery - Reject"));
out.println("<BODY><CENTER><img src=\"/" +rev+ "/images/foretees.gif\"><BR>");
out.println("<hr width=\"40%\">");
out.println("<BR><BR><H3>Member Restricted</H3><BR>");
out.println("<BR>Sorry, <b>5-somes</b> are restricted during this time.<br><br>");
out.println("<BR><BR>Would you like to override the restriction and allow this reservation?");
out.println("<BR><BR>");
//
// Return to _insert as directed
//
out.println("<font size=\"2\">");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"return\">");
out.println("<input type=\"submit\" value=\"No - Return\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form></font>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"returnCourse\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"date\" value=\"" + date + "\">");
out.println("<input type=\"hidden\" name=\"to_player\" value=\"" + slotParms.to_player + "\">");
out.println("<input type=\"hidden\" name=\"from_player\" value=\"" + slotParms.from_player + "\">");
out.println("<input type=\"hidden\" name=\"to_time\" value=\"" + slotParms.to_time + "\">");
out.println("<input type=\"hidden\" name=\"from_time\" value=\"" + slotParms.from_time + "\">");
out.println("<input type=\"hidden\" name=\"to_fb\" value=\"" + slotParms.to_fb + "\">");
out.println("<input type=\"hidden\" name=\"from_fb\" value=\"" + slotParms.from_fb + "\">");
out.println("<input type=\"hidden\" name=\"to_course\" value=\"" + slotParms.to_course + "\">");
out.println("<input type=\"hidden\" name=\"from_course\" value=\"" + slotParms.from_course + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"hidden\" name=\"prompt\" value=\"continue\">");
out.println("<input type=\"hidden\" name=\"skip\" value=\"3\">");
out.println("<input type=\"submit\" value=\"YES - Continue\" name=\"submit\"></form>");
out.println("</CENTER></BODY></HTML>");
out.close();
return;
}
}
} // end of IF 'return' reply from prompt
//
// OK to move player - move 'FROM' player info into this tee time (TO position)
//
to++; // change index back to position value
String moveP1 = "UPDATE teecurr2 SET player" +to+ " = ?, username" +to+ " = ?, p" +to+ "cw = ?, in_use = 0, hndcp" +to+ " = ?, show" +to+ " = ?, mNum" +to+ " = ?, userg" +to+ " = ?, p9" +to+ " = ?, pos" +to+ " = ? WHERE date = ? AND time = ? AND fb = ? AND courseName=?";
try {
pstmt6 = con.prepareStatement (moveP1);
pstmt6.clearParameters(); // clear the parms
pstmt6.setString(1, player[from]);
pstmt6.setString(2, user[from]);
pstmt6.setString(3, pcw[from]);
pstmt6.setFloat(4, hndcp[from]);
pstmt6.setShort(5, show[from]);
pstmt6.setString(6, mNum[from]);
pstmt6.setString(7, userg[from]);
pstmt6.setInt(8, p9[from]);
pstmt6.setShort(9, pos[from]);
pstmt6.setLong(10, date);
pstmt6.setInt(11, slotParms.to_time);
pstmt6.setInt(12, slotParms.to_fb);
pstmt6.setString(13, slotParms.to_course);
pstmt6.executeUpdate(); // execute the prepared stmt
pstmt6.close();
if (slotParms.sendEmail.equalsIgnoreCase( "yes" )) { // if ok to send emails
sendemail = 1; // send email notification
}
//
// Track the history of this tee time - make entry in 'teehist' table (first, get the new players)
//
pstmt6 = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setLong(1, date);
pstmt6.setInt(2, slotParms.to_time);
pstmt6.setInt(3, slotParms.to_fb);
pstmt6.setString(4, slotParms.to_course);
rs = pstmt6.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
player[4] = rs.getString(5);
}
pstmt6.close();
fullName = "Edit Tsheet Move Player From " +slotParms.from_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.to_time, slotParms.to_fb, slotParms.to_course, player[0], player[1], player[2],
player[3], player[4], slotParms.user, fullName, 1, con);
}
catch (Exception e1) {
String eMsg = "Error 3 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Finally, set the 'FROM' tee time to NOT in use and clear out the player info
//
String moveP2 = "UPDATE teecurr2 SET player" +fr+ " = '', username" +fr+ " = '', p" +fr+ "cw = '', in_use = 0, show" +fr+ " = 0, mNum" +fr+ " = '', userg" +fr+ " = '', pos" +fr+ " = 0 WHERE date = ? AND time = ? AND fb = ? AND courseName=?";
try {
PreparedStatement pstmt5 = con.prepareStatement (moveP2);
pstmt5.clearParameters(); // clear the parms
pstmt5.setLong(1, date);
pstmt5.setInt(2, slotParms.from_time);
pstmt5.setInt(3, slotParms.from_fb);
pstmt5.setString(4, slotParms.from_course);
pstmt5.executeUpdate(); // execute the prepared stmt
pstmt5.close();
//
// Track the history of this tee time - make entry in 'teehist' table (first get the new player list)
//
pstmt6 = con.prepareStatement (
"SELECT player1, player2, player3, player4, player5 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt6.clearParameters(); // clear the parms
pstmt6.setLong(1, date);
pstmt6.setInt(2, slotParms.from_time);
pstmt6.setInt(3, slotParms.from_fb);
pstmt6.setString(4, slotParms.from_course);
rs = pstmt6.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
player[4] = rs.getString(5);
}
pstmt6.close();
fullName = "Edit Tsheet Move Player To " +slotParms.to_time;
SystemUtils.updateHist(date, slotParms.day, slotParms.from_time, slotParms.from_fb, slotParms.from_course, player[0], player[1], player[2],
player[3], player[4], slotParms.user, fullName, 1, con);
}
catch (Exception e1) {
String eMsg = "Error 4 in moveSingle. ";
dbError(out, e1, slotParms.ind, slotParms.returnCourse, eMsg);
return;
}
//
// Done - return
//
editDone(out, slotParms, resp, req);
try {
resp.flushBuffer(); // force the repsonse to complete
}
catch (Exception ignore) {
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
if (sendemail != 0) {
try { // get the new 'to' tee time values
PreparedStatement pstmt5b = con.prepareStatement (
"SELECT player1, player2, player3, player4, username1, username2, username3, " +
"username4, p1cw, p2cw, p3cw, p4cw, " +
"player5, username5, p5cw, p91, p92, p93, p94, p95 " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt5b.clearParameters(); // clear the parms
pstmt5b.setLong(1, date);
pstmt5b.setInt(2, slotParms.to_time);
pstmt5b.setInt(3, slotParms.to_fb);
pstmt5b.setString(4, slotParms.to_course);
rs = pstmt5b.executeQuery();
if (rs.next()) {
player[0] = rs.getString(1);
player[1] = rs.getString(2);
player[2] = rs.getString(3);
player[3] = rs.getString(4);
user[0] = rs.getString(5);
user[1] = rs.getString(6);
user[2] = rs.getString(7);
user[3] = rs.getString(8);
pcw[0] = rs.getString(9);
pcw[1] = rs.getString(10);
pcw[2] = rs.getString(11);
pcw[3] = rs.getString(12);
player[4] = rs.getString(13);
user[4] = rs.getString(14);
pcw[4] = rs.getString(15);
p9[0] = rs.getInt(16);
p9[1] = rs.getInt(17);
p9[2] = rs.getInt(18);
p9[3] = rs.getInt(19);
p9[4] = rs.getInt(20);
}
pstmt5b.close();
}
catch (Exception ignoree) {
}
//
// allocate a parm block to hold the email parms
//
parmEmail parme = new parmEmail(); // allocate an Email parm block
//
// Set the values in the email parm block
//
parme.type = "tee"; // type = Move Single tee time (use tee and emailMod)
parme.date = date;
parme.time = slotParms.to_time;
parme.to_time = 0;
parme.from_time = 0;
parme.fb = slotParms.to_fb;
parme.to_fb = 0;
parme.from_fb = 0;
parme.to_course = slotParms.to_course;
parme.from_course = slotParms.from_course;
parme.mm = slotParms.mm;
parme.dd = slotParms.dd;
parme.yy = slotParms.yy;
parme.user = slotParms.user;
parme.emailNew = 0;
parme.emailMod = 1;
parme.emailCan = 0;
parme.p91 = p9[0];
parme.p92 = p9[1];
parme.p93 = p9[2];
parme.p94 = p9[3];
parme.p95 = p9[4];
parme.day = slotParms.day;
parme.player1 = player[0];
parme.player2 = player[1];
parme.player3 = player[2];
parme.player4 = player[3];
parme.player5 = player[4];
parme.oldplayer1 = slotParms.player1;
parme.oldplayer2 = slotParms.player2;
parme.oldplayer3 = slotParms.player3;
parme.oldplayer4 = slotParms.player4;
parme.oldplayer5 = slotParms.player5;
parme.user1 = user[0];
parme.user2 = user[1];
parme.user3 = user[2];
parme.user4 = user[3];
parme.user5 = user[4];
parme.olduser1 = slotParms.user1;
parme.olduser2 = slotParms.user2;
parme.olduser3 = slotParms.user3;
parme.olduser4 = slotParms.user4;
parme.olduser5 = slotParms.user5;
parme.pcw1 = pcw[0];
parme.pcw2 = pcw[1];
parme.pcw3 = pcw[2];
parme.pcw4 = pcw[3];
parme.pcw5 = pcw[4];
parme.oldpcw1 = slotParms.p1cw;
parme.oldpcw2 = slotParms.p2cw;
parme.oldpcw3 = slotParms.p3cw;
parme.oldpcw4 = slotParms.p4cw;
parme.oldpcw5 = slotParms.p5cw;
//
// Send the email
//
sendEmail.sendIt(parme, con); // in common
} // end of IF sendemail
} // end of moveSingle
/**
//************************************************************************
//
// Get tee time data
//
//************************************************************************
**/
private void getTeeTimeData(long date, int time, int fb, String course, parmSlot slotParms, Connection con)
throws Exception {
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
try {
pstmt = con.prepareStatement (
"SELECT * " +
"FROM teecurr2 WHERE date = ? AND time = ? AND fb = ? AND courseName = ?");
pstmt.clearParameters(); // clear the parms
pstmt.setLong(1, date); // put the parm in pstmt
pstmt.setInt(2, time);
pstmt.setInt(3, fb);
pstmt.setString(4, course);
rs = pstmt.executeQuery(); // execute the prepared stmt
if (rs.next()) {
slotParms.player1 = rs.getString( "player1" );
slotParms.player2 = rs.getString( "player2" );
slotParms.player3 = rs.getString( "player3" );
slotParms.player4 = rs.getString( "player4" );
slotParms.user1 = rs.getString( "username1" );
slotParms.user2 = rs.getString( "username2" );
slotParms.user3 = rs.getString( "username3" );
slotParms.user4 = rs.getString( "username4" );
slotParms.p1cw = rs.getString( "p1cw" );
slotParms.p2cw = rs.getString( "p2cw" );
slotParms.p3cw = rs.getString( "p3cw" );
slotParms.p4cw = rs.getString( "p4cw" );
slotParms.last_user = rs.getString( "in_use_by" );
slotParms.hndcp1 = rs.getFloat( "hndcp1" );
slotParms.hndcp2 = rs.getFloat( "hndcp2" );
slotParms.hndcp3 = rs.getFloat( "hndcp3" );
slotParms.hndcp4 = rs.getFloat( "hndcp4" );
slotParms.show1 = rs.getShort( "show1" );
slotParms.show2 = rs.getShort( "show2" );
slotParms.show3 = rs.getShort( "show3" );
slotParms.show4 = rs.getShort( "show4" );
slotParms.player5 = rs.getString( "player5" );
slotParms.user5 = rs.getString( "username5" );
slotParms.p5cw = rs.getString( "p5cw" );
slotParms.hndcp5 = rs.getFloat( "hndcp5" );
slotParms.show5 = rs.getShort( "show5" );
slotParms.notes = rs.getString( "notes" );
slotParms.hide = rs.getInt( "hideNotes" );
slotParms.rest5 = rs.getString( "rest5" );
slotParms.mNum1 = rs.getString( "mNum1" );
slotParms.mNum2 = rs.getString( "mNum2" );
slotParms.mNum3 = rs.getString( "mNum3" );
slotParms.mNum4 = rs.getString( "mNum4" );
slotParms.mNum5 = rs.getString( "mNum5" );
slotParms.userg1 = rs.getString( "userg1" );
slotParms.userg2 = rs.getString( "userg2" );
slotParms.userg3 = rs.getString( "userg3" );
slotParms.userg4 = rs.getString( "userg4" );
slotParms.userg5 = rs.getString( "userg5" );
slotParms.orig_by = rs.getString( "orig_by" );
slotParms.conf = rs.getString( "conf" );
slotParms.p91 = rs.getInt( "p91" );
slotParms.p92 = rs.getInt( "p92" );
slotParms.p93 = rs.getInt( "p93" );
slotParms.p94 = rs.getInt( "p94" );
slotParms.p95 = rs.getInt( "p95" );
slotParms.pos1 = rs.getShort( "pos1" );
slotParms.pos2 = rs.getShort( "pos2" );
slotParms.pos3 = rs.getShort( "pos3" );
slotParms.pos4 = rs.getShort( "pos4" );
slotParms.pos5 = rs.getShort( "pos5" );
}
pstmt.close();
}
catch (Exception e) {
throw new Exception("Error getting tee time data - Proshop_dlott.getTeeTimeData - Exception: " + e.getMessage());
}
}
// *********************************************************
// Done
// *********************************************************
private void editDone(PrintWriter out, parmSlot slotParms, HttpServletResponse resp, HttpServletRequest req) {
String hide = req.getParameter("hide");
try {
String url="/" +rev+ "/servlet/Proshop_dlott?index=" +slotParms.ind+ "&course=" + slotParms.returnCourse + "&jump=" + slotParms.jump + "&email=" + slotParms.sendEmail + "&hide=" +hide+ "&lott_name=" + slotParms.lottery;
resp.sendRedirect(url);
}
catch (Exception e1) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H3>System Error</H3>");
out.println("<BR><BR>A system error occurred while trying to return to the edit tee sheet.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, please contact customer support.");
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +slotParms.ind+ "&course=" +slotParms.returnCourse+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
}
// *********************************************************
// Tee Time Busy Error
// *********************************************************
private void teeBusy(PrintWriter out, parmSlot slotParms, HttpServletRequest req) {
String hide = req.getParameter("hide");
out.println(SystemUtils.HeadTitle("DB Record In Use Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H2>Tee Time Slot Busy</H2>");
out.println("<BR><BR>Sorry, but this tee time slot is currently busy.");
out.println("<BR><BR>If you are attempting to move a player to another position within the same tee time,");
out.println("<BR>you will have to Return to the Tee Sheet and select that tee time to update it.");
out.println("<BR><BR>Otherwise, please select another time or try again later.");
out.println("<BR><BR>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_dlott\" method=\"get\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=" + slotParms.ind + "></input>");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\"></input>");
out.println("<input type=\"hidden\" name=\"jump\" value=\"" + slotParms.jump + "\">");
out.println("<input type=\"hidden\" name=\"email\" value=\"" + slotParms.sendEmail + "\">");
out.println("<input type=\"hidden\" name=\"hide\" value=\"" + hide + "\">");
out.println("<input type=\"hidden\" name=\"lott_name\" value=\"" + slotParms.lottery + "\">");
out.println("<input type=\"submit\" value=\"Back to Lottery\" style=\"text-decoration:underline; background:#8B8970\"></form>");
out.println("<form action=\"/" +rev+ "/servlet/Proshop_jump\" method=\"post\" target=\"_top\">");
out.println("<input type=\"hidden\" name=\"index\" value=\"" + slotParms.ind + "\">");
out.println("<input type=\"hidden\" name=\"course\" value=\"" + slotParms.returnCourse + "\">");
out.println("<input type=\"submit\" value=\"Return to Tee Sheet\" name=\"return\" style=\"text-decoration:underline; background:#8B8970\">");
out.println("</form>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
// *********************************************************
// Database Error
// *********************************************************
private void dbError(PrintWriter out, Exception e1, int index, String course, String eMsg) {
out.println(SystemUtils.HeadTitle("DB Error"));
out.println("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");
out.println("<font size=\"2\" face=\"Arial, Helvetica, Sans-serif\">");
out.println("<CENTER><BR><BR><H3>Database Access Error</H3>");
out.println("<BR><BR>Unable to access the Database.");
out.println("<BR>Please try again later.");
out.println("<BR><BR>If problem persists, please contact customer support.");
out.println("<BR><BR>Error in dbError in Proshop_dlott:");
out.println("<BR><BR>" + eMsg + " Exc= " + e1.getMessage());
out.println("<BR><BR>");
out.println("<font size=\"2\">");
out.println("<a href=\"/" +rev+ "/servlet/Proshop_jump?index=" +index+ "&course=" +course+ "\">");
out.println("Return to Tee Sheet</a></font>");
out.println("</CENTER></BODY></HTML>");
out.close();
}
// *********************************************************
// Send any unsent emails
// *********************************************************
private void sendLotteryEmails2(String clubName, PrintWriter out, Connection con) {
Statement estmt = null;
Statement stmtN = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtd = null;
PreparedStatement pstmtd2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
String errorMsg = "";
String course = "";
String day = "";
int time = 0;
int atime1 = 0;
int atime2 = 0;
int atime3 = 0;
int atime4 = 0;
int atime5 = 0;
int groups = 0;
int dd = 0;
int mm = 0;
int yy = 0;
int afb = 0;
int afb2 = 0;
int afb3 = 0;
int afb4 = 0;
int afb5 = 0;
String user1 = "";
String user2 = "";
String user3 = "";
String user4 = "";
String user5 = "";
String player1 = "";
String player2 = "";
String player3 = "";
String player4 = "";
String player5 = "";
String userg1 = "";
String userg2 = "";
String userg3 = "";
String userg4 = "";
String userg5 = "";
String p1cw = "";
String p2cw = "";
String p3cw = "";
String p4cw = "";
String p5cw = "";
int p91 = 0;
int p92 = 0;
int p93 = 0;
int p94 = 0;
int p95 = 0;
String g1user1 = user1;
String g1user2 = user2;
String g1user3 = user3;
String g1user4 = user4;
String g1user5 = "";
String g1player1 = player1;
String g1player2 = player2;
String g1player3 = player3;
String g1player4 = player4;
String g1player5 = "";
String g1p1cw = p1cw;
String g1p2cw = p2cw;
String g1p3cw = p3cw;
String g1p4cw = p4cw;
String g1p5cw = "";
String g1userg1 = userg1;
String g1userg2 = userg2;
String g1userg3 = userg3;
String g1userg4 = userg4;
String g1userg5 = "";
int g1p91 = p91;
int g1p92 = p92;
int g1p93 = p93;
int g1p94 = p94;
int g1p95 = 0;
String g2user1 = "";
String g2user2 = "";
String g2user3 = "";
String g2user4 = "";
String g2user5 = "";
String g2player1 = "";
String g2player2 = "";
String g2player3 = "";
String g2player4 = "";
String g2player5 = "";
String g2p1cw = "";
String g2p2cw = "";
String g2p3cw = "";
String g2p4cw = "";
String g2p5cw = "";
String g2userg1 = "";
String g2userg2 = "";
String g2userg3 = "";
String g2userg4 = "";
String g2userg5 = "";
int g2p91 = 0;
int g2p92 = 0;
int g2p93 = 0;
int g2p94 = 0;
int g2p95 = 0;
String g3user1 = "";
String g3user2 = "";
String g3user3 = "";
String g3user4 = "";
String g3user5 = "";
String g3player1 = "";
String g3player2 = "";
String g3player3 = "";
String g3player4 = "";
String g3player5 = "";
String g3p1cw = "";
String g3p2cw = "";
String g3p3cw = "";
String g3p4cw = "";
String g3p5cw = "";
String g3userg1 = "";
String g3userg2 = "";
String g3userg3 = "";
String g3userg4 = "";
String g3userg5 = "";
int g3p91 = 0;
int g3p92 = 0;
int g3p93 = 0;
int g3p94 = 0;
int g3p95 = 0;
String g4user1 = "";
String g4user2 = "";
String g4user3 = "";
String g4user4 = "";
String g4user5 = "";
String g4player1 = "";
String g4player2 = "";
String g4player3 = "";
String g4player4 = "";
String g4player5 = "";
String g4p1cw = "";
String g4p2cw = "";
String g4p3cw = "";
String g4p4cw = "";
String g4p5cw = "";
String g4userg1 = "";
String g4userg2 = "";
String g4userg3 = "";
String g4userg4 = "";
String g4userg5 = "";
int g4p91 = 0;
int g4p92 = 0;
int g4p93 = 0;
int g4p94 = 0;
int g4p95 = 0;
String g5user1 = "";
String g5user2 = "";
String g5user3 = "";
String g5user4 = "";
String g5user5 = "";
String g5player1 = "";
String g5player2 = "";
String g5player3 = "";
String g5player4 = "";
String g5player5 = "";
String g5p1cw = "";
String g5p2cw = "";
String g5p3cw = "";
String g5p4cw = "";
String g5p5cw = "";
String g5userg1 = "";
String g5userg2 = "";
String g5userg3 = "";
String g5userg4 = "";
String g5userg5 = "";
int g5p91 = 0;
int g5p92 = 0;
int g5p93 = 0;
int g5p94 = 0;
int g5p95 = 0;
//*****************************************************************************
// Send an email to all in this request
//*****************************************************************************
//
try {
estmt = con.createStatement(); // create a statement
rs = estmt.executeQuery("" +
"SELECT * " +
"FROM teecurr2 " +
"WHERE lottery = ? AND lottery_email <> 0;");
while (rs.next()) {
player1 = rs.getString("player1");
player2 = rs.getString("player2");
player3 = rs.getString("player3");
player4 = rs.getString("player4");
player5 = rs.getString("player5");
user1 = rs.getString("username1");
user2 = rs.getString("username2");
user3 = rs.getString("username3");
user4 = rs.getString("username4");
user5 = rs.getString("username5");
p1cw = rs.getString("p1cw");
p2cw = rs.getString("p2cw");
p3cw = rs.getString("p3cw");
p4cw = rs.getString("p4cw");
p5cw = rs.getString("p5cw");
//
// Get today's date and time for email processing
//
Calendar ecal = new GregorianCalendar(); // get todays date
int eyear = ecal.get(Calendar.YEAR);
int emonth = ecal.get(Calendar.MONTH);
int eday = ecal.get(Calendar.DAY_OF_MONTH);
int e_hourDay = ecal.get(Calendar.HOUR_OF_DAY);
int e_min = ecal.get(Calendar.MINUTE);
int e_time = 0;
long e_date = 0;
//
// Build the 'time' string for display
//
// Adjust the time based on the club's time zone (we are Central)
//
e_time = (e_hourDay * 100) + e_min;
e_time = SystemUtils.adjustTime(con, e_time); // adjust for time zone
if (e_time < 0) { // if negative, then we went back or ahead one day
e_time = 0 - e_time; // convert back to positive value
if (e_time < 100) { // if hour is zero, then we rolled ahead 1 day
//
// roll cal ahead 1 day (its now just after midnight, the next day Eastern Time)
//
ecal.add(Calendar.DATE,1); // get next day's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
} else { // we rolled back 1 day
//
// roll cal back 1 day (its now just before midnight, yesterday Pacific or Mountain Time)
//
ecal.add(Calendar.DATE,-1); // get yesterday's date
eyear = ecal.get(Calendar.YEAR);
emonth = ecal.get(Calendar.MONTH);
eday = ecal.get(Calendar.DAY_OF_MONTH);
}
}
int e_hour = e_time / 100; // get adjusted hour
e_min = e_time - (e_hour * 100); // get minute value
int e_am_pm = 0; // preset to AM
if (e_hour > 11) {
e_am_pm = 1; // PM
e_hour = e_hour - 12; // set to 12 hr clock
}
if (e_hour == 0) {
e_hour = 12;
}
String email_time = "";
emonth = emonth + 1; // month starts at zero
e_date = (eyear * 10000) + (emonth * 100) + eday;
//
// get date/time string for email message
//
if (e_am_pm == 0) {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " AM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " AM";
}
} else {
if (e_min < 10) {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":0" + e_min + " PM";
} else {
email_time = emonth + "/" + eday + "/" + eyear + " at " + e_hour + ":" + e_min + " PM";
}
}
//
//***********************************************
// Send email notification if necessary
//***********************************************
//
String to = ""; // to address
String f_b = "";
String eampm = "";
String etime = "";
String enewMsg = "";
int emailOpt = 0; // user's email option parm
int ehr = 0;
int emin = 0;
int send = 0;
PreparedStatement pstmte1 = null;
//
// set the front/back value
//
f_b = "Front";
if (afb == 1) {
f_b = "Back";
}
String enew1 = "";
String enew2 = "";
String subject = "";
if (clubName.startsWith( "Old Oaks" )) {
enew1 = "The following Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Tee Time Assignment Notification";
} else {
if (clubName.startsWith( "Westchester" )) {
enew1 = "The following Draw Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Draw Tee Times have been ASSIGNED.\n\n";
subject = "Your Tee Time for Weekend Draw";
} else {
enew1 = "The following Lottery Tee Time has been ASSIGNED.\n\n";
enew2 = "The following Lottery Tee Times have been ASSIGNED.\n\n";
subject = "ForeTees Lottery Assignment Notification";
}
}
if (!clubName.equals( "" )) {
subject = subject + " - " + clubName;
}
Properties properties = new Properties();
properties.put("mail.smtp.host", SystemUtils.host); // set outbound host address
properties.put("mail.smtp.port", SystemUtils.port); // set outbound port
properties.put("mail.smtp.auth", "true"); // set 'use authentication'
Session mailSess = Session.getInstance(properties, SystemUtils.getAuthenticator()); // get session properties
MimeMessage message = new MimeMessage(mailSess);
try {
message.setFrom(new InternetAddress(SystemUtils.EFROM)); // set from addr
message.setSubject( subject ); // set subject line
message.setSentDate(new java.util.Date()); // set date/time sent
}
catch (Exception ignore) {
}
//
// Set the recipient addresses
//
if (!g1user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g1user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g1user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g2user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g2user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g3user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g3user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g4user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g4user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user1.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user1);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user2.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user2);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user3.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user3);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user4.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user4);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
if (!g5user5.equals( "" )) { // if new user exist and not same as old usernames
try {
pstmte1 = con.prepareStatement (
"SELECT email, emailOpt FROM member2b WHERE username = ?");
pstmte1.clearParameters(); // clear the parms
pstmte1.setString(1, g5user5);
rs2 = pstmte1.executeQuery(); // execute the prepared stmt
if (rs2.next()) {
to = rs2.getString(1); // user's email address
emailOpt = rs2.getInt(2); // email option
if ((emailOpt != 0) && (!to.equals( "" ))) { // if user wants email notifications
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
send = 1;
}
}
pstmte1.close(); // close the stmt
}
catch (Exception ignore) {
}
}
//
// send email if anyone to send it to
//
if (send != 0) { // if any email addresses specified for members
//
// Create the message content
//
if (groups > 1) {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew2 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
} else {
if (afb == afb2 && afb == afb3 && afb == afb4 && afb == afb5) { // if all on the same tee
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on the " + f_b + " tee ";
} else {
enewMsg = SystemUtils.header + enew1 + day + " " + mm + "/" + dd + "/" + yy + " " +
"on both tees ";
}
}
if (!course.equals( "" )) {
enewMsg = enewMsg + "of Course: " + course;
}
//
// convert time to hour and minutes for email msg
//
time = atime1; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n at " + etime + "\n";
if (!g1player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g1player1 + " " + g1p1cw;
}
if (!g1player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g1player2 + " " + g1p2cw;
}
if (!g1player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g1player3 + " " + g1p3cw;
}
if (!g1player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g1player4 + " " + g1p4cw;
}
if (!g1player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g1player5 + " " + g1p5cw;
}
if (groups > 1) {
time = atime2; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g2player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g2player1 + " " + g2p1cw;
}
if (!g2player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g2player2 + " " + g2p2cw;
}
if (!g2player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g2player3 + " " + g2p3cw;
}
if (!g2player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g2player4 + " " + g2p4cw;
}
if (!g2player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g2player5 + " " + g2p5cw;
}
}
if (groups > 2) {
time = atime3; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g3player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g3player1 + " " + g3p1cw;
}
if (!g3player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g3player2 + " " + g3p2cw;
}
if (!g3player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g3player3 + " " + g3p3cw;
}
if (!g3player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g3player4 + " " + g3p4cw;
}
if (!g3player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g3player5 + " " + g3p5cw;
}
}
if (groups > 3) {
time = atime4; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g4player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g4player1 + " " + g4p1cw;
}
if (!g4player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g4player2 + " " + g4p2cw;
}
if (!g4player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g4player3 + " " + g4p3cw;
}
if (!g4player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g4player4 + " " + g4p4cw;
}
if (!g4player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g4player5 + " " + g4p5cw;
}
}
if (groups > 4) {
time = atime5; // time for this tee time
ehr = time / 100;
emin = time - (ehr * 100);
eampm = " AM";
if (ehr > 12) {
eampm = " PM";
ehr = ehr - 12; // convert from military time
}
if (ehr == 12) {
eampm = " PM";
}
if (ehr == 0) {
ehr = 12;
eampm = " AM";
}
if (emin < 10) {
etime = ehr + ":0" + emin + eampm;
} else {
etime = ehr + ":" + emin + eampm;
}
enewMsg = enewMsg + "\n\n at " + etime + "\n";
if (!g5player1.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 1: " + g5player1 + " " + g5p1cw;
}
if (!g5player2.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 2: " + g5player2 + " " + g5p2cw;
}
if (!g5player3.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 3: " + g5player3 + " " + g5p3cw;
}
if (!g5player4.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 4: " + g5player4 + " " + g5p4cw;
}
if (!g5player5.equals( "" )) {
enewMsg = enewMsg + "\nPlayer 5: " + g5player5 + " " + g5p5cw;
}
}
enewMsg = enewMsg + SystemUtils.trailer;
try {
message.setText( enewMsg ); // put msg in email text area
Transport.send(message); // send it!!
}
catch (Exception ignore) {
}
} // end of IF send
} // end while loop for teecurr2
estmt.close();
}
catch (Exception ignore) {
}
}
private void sendLotteryEmails(String clubName, PrintWriter out, Connection con) {
parmEmail parme = new parmEmail(); // allocate an Email parm block
ResultSet rs = null;
Statement stmt = null;
}
} // end servlet | 452,760 | 0.46452 | 0.440721 | 10,972 | 39.265221 | 36.721939 | 375 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.733595 | false | false | 15 |
4d394a4a7bad48de5acea098b5dd5be9c9721e3c | 8,572,754,728,983 | aeff586954785350d47ef4112c7b5c64245949cd | /Cine/src/main/java/com/cine/serviceimpl/GeneroServiceImpl.java | 96dfa3d73379dbef9eeda78ac7527d8e73963784 | [] | no_license | maocber/salascine | https://github.com/maocber/salascine | 08ef57a83a43ef504c57450283c685c2d2bf9390 | 53b346eeef5a77bc0b2ea82a52125574b147b7bd | refs/heads/main | 2023-03-12T10:20:51.498000 | 2021-03-05T00:28:03 | 2021-03-05T00:28:03 | 340,663,862 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cine.serviceimpl;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cine.dto.GeneroDTO;
import com.cine.entity.GeneroEntity;
import com.cine.repository.IGeneroRepository;
import com.cine.service.IGeneroService;
import com.cine.util.ModelMapperUtil;
@Service
public class GeneroServiceImpl implements IGeneroService {
private static final Logger LOG = LoggerFactory.getLogger(GeneroServiceImpl.class);
@Autowired
IGeneroRepository generoRepository;
@Autowired
ModelMapperUtil mapper;
@Override
public GeneroDTO adicionar(GeneroDTO genero) {
try {
GeneroEntity generoEntity = mapper.map(genero, GeneroEntity.class);
generoRepository.save(generoEntity);
} catch (Exception e) {
LOG.error("Error al guardar el genero {}", e.getMessage());
}
return genero;
}
@Override
public List<GeneroDTO> verGeneros() {
List<GeneroDTO> lstGeneros = new ArrayList<>();
try {
List<GeneroEntity> lstGenerosEntity = generoRepository.findAll();
lstGeneros = mapper.mapAll(lstGenerosEntity, GeneroDTO.class);
} catch (Exception e) {
LOG.error("Error al consultar el listado de generos: {}", e.getMessage());
}
return lstGeneros;
}
}
| UTF-8 | Java | 1,363 | java | GeneroServiceImpl.java | Java | [] | null | [] | package com.cine.serviceimpl;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cine.dto.GeneroDTO;
import com.cine.entity.GeneroEntity;
import com.cine.repository.IGeneroRepository;
import com.cine.service.IGeneroService;
import com.cine.util.ModelMapperUtil;
@Service
public class GeneroServiceImpl implements IGeneroService {
private static final Logger LOG = LoggerFactory.getLogger(GeneroServiceImpl.class);
@Autowired
IGeneroRepository generoRepository;
@Autowired
ModelMapperUtil mapper;
@Override
public GeneroDTO adicionar(GeneroDTO genero) {
try {
GeneroEntity generoEntity = mapper.map(genero, GeneroEntity.class);
generoRepository.save(generoEntity);
} catch (Exception e) {
LOG.error("Error al guardar el genero {}", e.getMessage());
}
return genero;
}
@Override
public List<GeneroDTO> verGeneros() {
List<GeneroDTO> lstGeneros = new ArrayList<>();
try {
List<GeneroEntity> lstGenerosEntity = generoRepository.findAll();
lstGeneros = mapper.mapAll(lstGenerosEntity, GeneroDTO.class);
} catch (Exception e) {
LOG.error("Error al consultar el listado de generos: {}", e.getMessage());
}
return lstGeneros;
}
}
| 1,363 | 0.766691 | 0.765224 | 52 | 25.211538 | 23.835443 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.538462 | false | false | 15 |
4132c12843e315fd19b4d0238372d97eb181e522 | 9,156,870,339,468 | 1bb6a48882f1893166b6fa3d757223e2421daf6d | /src/com/pieisnotpi/engine/rendering/shaders/types/tex/TexShader.java | 4cd92e59b801a6922fcbd81f4f991afc0077b524 | [] | no_license | pieisnotpi/Pi-Engine | https://github.com/pieisnotpi/Pi-Engine | 609b3fdae6e2a00c279537221e2ba2b175e33324 | ec76246654c3190055e0ef51709e2d7c0e2d20a8 | refs/heads/master | 2021-01-17T15:59:48.083000 | 2020-01-11T01:27:53 | 2020-01-11T01:27:53 | 58,401,271 | 0 | 0 | null | false | 2020-01-11T01:27:54 | 2016-05-09T19:08:40 | 2017-08-07T01:09:42 | 2020-01-11T01:27:54 | 6,474 | 0 | 0 | 0 | Java | false | false | package com.pieisnotpi.engine.rendering.shaders.types.tex;
import com.pieisnotpi.engine.rendering.shaders.ShaderFile;
import com.pieisnotpi.engine.rendering.shaders.ShaderProgram;
import com.pieisnotpi.engine.rendering.window.Window;
public class TexShader extends ShaderProgram
{
public static final int ID = 11246;
public TexShader(Window window)
{
super(window, ShaderFile.getShaderFile("textured.vert", ShaderFile.TYPE_VERT), ShaderFile.getShaderFile("textured.frag", ShaderFile.TYPE_FRAG));
}
}
| UTF-8 | Java | 527 | java | TexShader.java | Java | [] | null | [] | package com.pieisnotpi.engine.rendering.shaders.types.tex;
import com.pieisnotpi.engine.rendering.shaders.ShaderFile;
import com.pieisnotpi.engine.rendering.shaders.ShaderProgram;
import com.pieisnotpi.engine.rendering.window.Window;
public class TexShader extends ShaderProgram
{
public static final int ID = 11246;
public TexShader(Window window)
{
super(window, ShaderFile.getShaderFile("textured.vert", ShaderFile.TYPE_VERT), ShaderFile.getShaderFile("textured.frag", ShaderFile.TYPE_FRAG));
}
}
| 527 | 0.781784 | 0.772296 | 15 | 34.133335 | 39.681847 | 152 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 15 |
febf6c200a0dfd75123695ef94888d569c2b7e59 | 9,242,769,645,890 | ef85eedcde15da78f9dfa74b13b0cd2b829446f4 | /sdk/src/main/java/com/virgilsecurity/sdk/common/TimeSpan.java | 22dd14f7d9c34a7216ef352f4d4a07b63486156e | [
"BSD-3-Clause"
] | permissive | VirgilSecurity/virgil-sdk-java-android | https://github.com/VirgilSecurity/virgil-sdk-java-android | c686198cb8112304e28ad83e9d77701cbcb260fa | 276a5db1cb417d467835d1afaf5dd331bcfb7247 | refs/heads/master | 2021-05-24T02:39:28.408000 | 2020-06-24T10:32:01 | 2020-06-24T10:32:01 | 52,774,196 | 32 | 9 | NOASSERTION | false | 2020-06-24T10:32:03 | 2016-02-29T08:00:51 | 2020-05-22T07:26:44 | 2020-06-24T10:32:02 | 136,866 | 22 | 6 | 1 | Java | false | false | /*
* Copyright (c) 2015-2020, Virgil Security, Inc.
*
* Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* (3) Neither the name of virgil nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.virgilsecurity.sdk.common;
import java.util.concurrent.TimeUnit;
/**
* The {@link TimeSpan} class is implemented to simplify work with time spans. You can easily
* specify the time span for 5 min for example.
*/
public final class TimeSpan {
private long lifetime;
private TimeUnit timeUnit;
/**
* Represents time span (interval) in specified time unit.
*
* @param lifetime in specified by second argument unit. Must be >= 0.
* @param timeUnit any {@link TimeUnit}.
* @return TimeSpan instance with time span in specified unit.
*/
public static TimeSpan fromTime(long lifetime, TimeUnit timeUnit) {
if (lifetime <= 0) {
throw new IllegalArgumentException("Value of 'lifetime' should be more that zero (0)");
}
return new TimeSpan(lifetime, timeUnit);
}
private TimeSpan(long lifetime, TimeUnit timeUnit) {
this.lifetime = lifetime;
this.timeUnit = timeUnit;
}
/**
* If TimeSpan was cleared - time span will be added to zero (0) value.
*
* @param increment the milliseconds to be added to current time. Must be >= 0.
*/
public void add(long increment) {
if (increment <= 0) {
throw new IllegalArgumentException("Value of 'increment' should be more that zero (0)");
}
this.lifetime += increment;
}
/**
* Clears time span to zero (0) value.
*/
public void clear() {
lifetime = 0;
}
/**
* Decrease the expire interval. Cannot be less than zero (0). (Ex. timeSpan.add(2);
* timeSpan.decrease(5); timeSpan.getSpan(); output value is zero (0))
*
* @param decrement to decrease the expire interval. Must be >= 0.
*/
public void decrease(long decrement) {
if (decrement <= 0) {
throw new IllegalArgumentException("Value of 'decrement' should be more that zero (0)");
}
this.lifetime -= decrement;
}
/**
* Get time span.
*
* @return Time Span in milliseconds.
*/
public long getSpanMilliseconds() {
return getSpanSeconds() * 1000;
}
/**
* Get time span.
*
* @return Time Span in seconds.
*/
public long getSpanSeconds() {
if (lifetime == 0) {
return 0;
}
switch (timeUnit) {
case NANOSECONDS:
return lifetime / 1000000000; // 1000000000 nanoseconds is 1 second
case MICROSECONDS:
return lifetime / 1000000; // 1000000 microseconds is 1 second
case MILLISECONDS:
return lifetime / 1000; // 1000 milliseconds is 1 second
case SECONDS:
return lifetime;
case MINUTES:
return lifetime * 60;
case HOURS:
return lifetime * 60 * 60;
case DAYS:
return lifetime * 24 * 60 * 60;
default:
return lifetime;
}
}
}
| UTF-8 | Java | 4,429 | java | TimeSpan.java | Java | [
{
"context": "/*\n * Copyright (c) 2015-2020, Virgil Security, Inc.\n *\n * Lead Maintainer: Virgil Security Inc.",
"end": 46,
"score": 0.9745920896530151,
"start": 31,
"tag": "NAME",
"value": "Virgil Security"
},
{
"context": "2020, Virgil Security, Inc.\n *\n * Lead Maintainer: Vir... | null | [] | /*
* Copyright (c) 2015-2020, <NAME>, Inc.
*
* Lead Maintainer: <NAME> Inc. <<EMAIL>>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* (3) Neither the name of virgil nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.virgilsecurity.sdk.common;
import java.util.concurrent.TimeUnit;
/**
* The {@link TimeSpan} class is implemented to simplify work with time spans. You can easily
* specify the time span for 5 min for example.
*/
public final class TimeSpan {
private long lifetime;
private TimeUnit timeUnit;
/**
* Represents time span (interval) in specified time unit.
*
* @param lifetime in specified by second argument unit. Must be >= 0.
* @param timeUnit any {@link TimeUnit}.
* @return TimeSpan instance with time span in specified unit.
*/
public static TimeSpan fromTime(long lifetime, TimeUnit timeUnit) {
if (lifetime <= 0) {
throw new IllegalArgumentException("Value of 'lifetime' should be more that zero (0)");
}
return new TimeSpan(lifetime, timeUnit);
}
private TimeSpan(long lifetime, TimeUnit timeUnit) {
this.lifetime = lifetime;
this.timeUnit = timeUnit;
}
/**
* If TimeSpan was cleared - time span will be added to zero (0) value.
*
* @param increment the milliseconds to be added to current time. Must be >= 0.
*/
public void add(long increment) {
if (increment <= 0) {
throw new IllegalArgumentException("Value of 'increment' should be more that zero (0)");
}
this.lifetime += increment;
}
/**
* Clears time span to zero (0) value.
*/
public void clear() {
lifetime = 0;
}
/**
* Decrease the expire interval. Cannot be less than zero (0). (Ex. timeSpan.add(2);
* timeSpan.decrease(5); timeSpan.getSpan(); output value is zero (0))
*
* @param decrement to decrease the expire interval. Must be >= 0.
*/
public void decrease(long decrement) {
if (decrement <= 0) {
throw new IllegalArgumentException("Value of 'decrement' should be more that zero (0)");
}
this.lifetime -= decrement;
}
/**
* Get time span.
*
* @return Time Span in milliseconds.
*/
public long getSpanMilliseconds() {
return getSpanSeconds() * 1000;
}
/**
* Get time span.
*
* @return Time Span in seconds.
*/
public long getSpanSeconds() {
if (lifetime == 0) {
return 0;
}
switch (timeUnit) {
case NANOSECONDS:
return lifetime / 1000000000; // 1000000000 nanoseconds is 1 second
case MICROSECONDS:
return lifetime / 1000000; // 1000000 microseconds is 1 second
case MILLISECONDS:
return lifetime / 1000; // 1000 milliseconds is 1 second
case SECONDS:
return lifetime;
case MINUTES:
return lifetime * 60;
case HOURS:
return lifetime * 60 * 60;
case DAYS:
return lifetime * 24 * 60 * 60;
default:
return lifetime;
}
}
}
| 4,392 | 0.680515 | 0.659968 | 139 | 30.86331 | 30.102751 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.402878 | false | false | 15 |
9d0eb50b4bdc2da9a72e166ce7c923fd667b6e71 | 31,396,210,952,835 | 7fce44ca263776bbd170e622614b67c9d33977e2 | /app/src/main/java/com/example/dpandstatus/latestdp/LatestDpFragment.java | 5bde37aedeff7c717e1af633f5ad0d54de71b2b4 | [] | no_license | shivamishra454/whatsappStatus | https://github.com/shivamishra454/whatsappStatus | a55e9590c13d41c2d5e957d35282bf12b0f0f01e | 0f77521de80b9f7ff58d7d5d9a5801a3cdc59d02 | refs/heads/master | 2023-07-08T22:16:46.173000 | 2021-08-02T10:47:19 | 2021-08-02T10:47:19 | 391,908,745 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.dpandstatus.latestdp;
import android.content.res.AssetManager;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import com.example.dpandstatus.categorie.Database;
import com.example.dpandstatus.R;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
public class LatestDpFragment extends Fragment {
private static final int CELL_COUNT =1 ;
ArrayList<String> list=new ArrayList<>();
RecyclerView recyclerView;
SwipeRefreshLayout mSwipeRefreshLayout;
public LatestDpFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view= inflater.inflate( R.layout.fragment_latest_dp, container, false );
// readFiles();
recyclerView = view.findViewById(R.id.recyclerview);
int numberOfColumns = 3;
setDataInRecycler( (new Database()).getLatestDp());
return view;
}
private void readFiles() {
AsyncTask.execute( new Runnable() {
@Override
public void run() {
try {
InputStream myInput;
AssetManager assetManager = getContext().getAssets();
myInput = assetManager.open("sad.xlsx");
// InputStream intStream = getContentResolver().openInputStream(fileUri);
Log.e("tag", myInput.toString());
XSSFWorkbook workBook = new XSSFWorkbook(myInput);
XSSFSheet sheet = workBook.getSheetAt(0);
FormulaEvaluator formulaEvaluator = workBook.getCreationHelper().createFormulaEvaluator();
int rowCount = sheet.getPhysicalNumberOfRows();
Log.e("Tah", "row count "+String.valueOf( rowCount ) );
if (rowCount > 0) {
for (int r = 0; r < rowCount; r++) {
Row row = sheet.getRow(r);
if (row.getPhysicalNumberOfCells() == CELL_COUNT) {
String link = row.getCell(0).getStringCellValue();
Log.e("Tah", link);
list.add( getCorrectUrl(link) );
} else {
final int finalR1 = r;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
//loadingDialog.dismiss();
// Toast.makeText(MainActivity.this, "Row No " + (finalR1 + 1) + " has incorrect data!", Toast.LENGTH_SHORT).show();
}
});
return;
}
//setDataInRecycler(list);
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Done....");
// loadingDialog.dismiss();
//Toast.makeText(MainActivity.this, "Row No " + (finalR1 + 1) + " has incorrect data!", Toast.LENGTH_SHORT).show();
}
});
} else {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
// loadingDialog.dismiss();
//Toast.makeText(MainActivity.this, "File is Empty!", Toast.LENGTH_SHORT).show();
}
});
}
} catch (final IOException e) {
e.printStackTrace();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
// loadingDialog.dismiss();
// Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
});
}
private void setDataInRecycler(ArrayList<String> list1) {
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL));
LatestDpAdapter adapter= new LatestDpAdapter( list1, getContext() );
int resId = R.anim.layout_animation_fall_down;
LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(getContext(), resId);
recyclerView.setLayoutAnimation(animation);
recyclerView.setAdapter( adapter );
}
private String getCorrectUrl(String url){
String driveLink = "https://drive.google.com/uc?export=download&id=";
String[] urlCode = url.split( "/" );
return driveLink + urlCode[5];
}
} | UTF-8 | Java | 6,172 | java | LatestDpFragment.java | Java | [] | null | [] | package com.example.dpandstatus.latestdp;
import android.content.res.AssetManager;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import com.example.dpandstatus.categorie.Database;
import com.example.dpandstatus.R;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
public class LatestDpFragment extends Fragment {
private static final int CELL_COUNT =1 ;
ArrayList<String> list=new ArrayList<>();
RecyclerView recyclerView;
SwipeRefreshLayout mSwipeRefreshLayout;
public LatestDpFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view= inflater.inflate( R.layout.fragment_latest_dp, container, false );
// readFiles();
recyclerView = view.findViewById(R.id.recyclerview);
int numberOfColumns = 3;
setDataInRecycler( (new Database()).getLatestDp());
return view;
}
private void readFiles() {
AsyncTask.execute( new Runnable() {
@Override
public void run() {
try {
InputStream myInput;
AssetManager assetManager = getContext().getAssets();
myInput = assetManager.open("sad.xlsx");
// InputStream intStream = getContentResolver().openInputStream(fileUri);
Log.e("tag", myInput.toString());
XSSFWorkbook workBook = new XSSFWorkbook(myInput);
XSSFSheet sheet = workBook.getSheetAt(0);
FormulaEvaluator formulaEvaluator = workBook.getCreationHelper().createFormulaEvaluator();
int rowCount = sheet.getPhysicalNumberOfRows();
Log.e("Tah", "row count "+String.valueOf( rowCount ) );
if (rowCount > 0) {
for (int r = 0; r < rowCount; r++) {
Row row = sheet.getRow(r);
if (row.getPhysicalNumberOfCells() == CELL_COUNT) {
String link = row.getCell(0).getStringCellValue();
Log.e("Tah", link);
list.add( getCorrectUrl(link) );
} else {
final int finalR1 = r;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
//loadingDialog.dismiss();
// Toast.makeText(MainActivity.this, "Row No " + (finalR1 + 1) + " has incorrect data!", Toast.LENGTH_SHORT).show();
}
});
return;
}
//setDataInRecycler(list);
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Done....");
// loadingDialog.dismiss();
//Toast.makeText(MainActivity.this, "Row No " + (finalR1 + 1) + " has incorrect data!", Toast.LENGTH_SHORT).show();
}
});
} else {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
// loadingDialog.dismiss();
//Toast.makeText(MainActivity.this, "File is Empty!", Toast.LENGTH_SHORT).show();
}
});
}
} catch (final IOException e) {
e.printStackTrace();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// loadingText.setText("Loading....");
// loadingDialog.dismiss();
// Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
});
}
private void setDataInRecycler(ArrayList<String> list1) {
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL));
LatestDpAdapter adapter= new LatestDpAdapter( list1, getContext() );
int resId = R.anim.layout_animation_fall_down;
LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(getContext(), resId);
recyclerView.setLayoutAnimation(animation);
recyclerView.setAdapter( adapter );
}
private String getCorrectUrl(String url){
String driveLink = "https://drive.google.com/uc?export=download&id=";
String[] urlCode = url.split( "/" );
return driveLink + urlCode[5];
}
} | 6,172 | 0.523169 | 0.520739 | 163 | 36.871166 | 31.261051 | 155 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.595092 | false | false | 15 |
13beeb4b5a8b189ec4c2e5fbf4ce86fdba5123b7 | 23,398,981,890,921 | 85063dc202c1cbea67889568762342e767c83591 | /src/Pruefungsvorbereitung/StatsHelper.java | bd2fc42af1fd1e0c2a36714966ec353ec0edd7ae | [] | no_license | krikal85/HelloGitHub | https://github.com/krikal85/HelloGitHub | 0025ca21f363043f5dba1560381342c46af4c14a | 3bdd33820c8e6166aec66c80fe1ca83a16887cfd | refs/heads/master | 2021-01-10T22:39:25.038000 | 2017-03-11T14:56:00 | 2017-03-11T14:56:15 | 69,571,782 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Pruefungsvorbereitung;
public class StatsHelper {
public static void main(String[] args) {
int[][] numbers = {{3,4,-1},{10,7,0}};
int[] num = {3,2,7,9,1,4};
//calcSimpleStats(numbers);
/* int [] array = einDimFeld(numbers);
System.out.println("Lšnge: "+numbers.length);
for (int i = 0; i <= numbers.length*2; i++) {
System.out.print(array[i]+"\t");
}
*/
sortieren(num);
for (int i = 0; i < num.length; i++)
{
System.out.print(num[i] + "\t");
}
}
public static double[] calcSimpleStats(int[][] numbers)
{
double min = Double.MAX_VALUE;
double max = Double.MIN_VALUE;
double avg = 0;
double avgsum = 0;
int count = 0;
int i = 0;
int j = 0;
for (i = 0; i < numbers.length; i++)
{
for (j = 0; j < numbers[i].length; j++)
{
//numbers[i][j] = (int) (Math.random() % 100);
if(numbers[i][j] < min)
{
min = numbers[i][j];
}
if(numbers[i][j] > max)
{
max = numbers[i][j];
}
avgsum = avgsum + numbers[i][j];
count++;
}
}
avg = avgsum / count;
double[] array = {min, max, avg};
for (int k = 0; k < array.length; k++)
{
System.out.print(array[k] + ", ");
}
return array;
}
public static int[] einDimFeld(int[][] numbers)
{
int[] array = new int[numbers.length * numbers[0].length];
int index = 0;
for (int i = 0; i < numbers.length; i++)
{
for (int j = 0; j < numbers[i].length; j++) {
System.out.println("Index: "+index);
array[index++] = numbers[i][j];
}
}
return array;
}
public static void sortieren(int[] numbers)
{
for (int i = 0; i < numbers.length -1; i++)
{
int aktuell = numbers[i];
int nachbar = numbers[i +1];
if(aktuell > nachbar)
{
numbers[i + 1] = aktuell;
numbers[i] = nachbar;
sortieren(numbers);
}
}
}
}
| MacCentralEurope | Java | 1,985 | java | StatsHelper.java | Java | [] | null | [] | package Pruefungsvorbereitung;
public class StatsHelper {
public static void main(String[] args) {
int[][] numbers = {{3,4,-1},{10,7,0}};
int[] num = {3,2,7,9,1,4};
//calcSimpleStats(numbers);
/* int [] array = einDimFeld(numbers);
System.out.println("Lšnge: "+numbers.length);
for (int i = 0; i <= numbers.length*2; i++) {
System.out.print(array[i]+"\t");
}
*/
sortieren(num);
for (int i = 0; i < num.length; i++)
{
System.out.print(num[i] + "\t");
}
}
public static double[] calcSimpleStats(int[][] numbers)
{
double min = Double.MAX_VALUE;
double max = Double.MIN_VALUE;
double avg = 0;
double avgsum = 0;
int count = 0;
int i = 0;
int j = 0;
for (i = 0; i < numbers.length; i++)
{
for (j = 0; j < numbers[i].length; j++)
{
//numbers[i][j] = (int) (Math.random() % 100);
if(numbers[i][j] < min)
{
min = numbers[i][j];
}
if(numbers[i][j] > max)
{
max = numbers[i][j];
}
avgsum = avgsum + numbers[i][j];
count++;
}
}
avg = avgsum / count;
double[] array = {min, max, avg};
for (int k = 0; k < array.length; k++)
{
System.out.print(array[k] + ", ");
}
return array;
}
public static int[] einDimFeld(int[][] numbers)
{
int[] array = new int[numbers.length * numbers[0].length];
int index = 0;
for (int i = 0; i < numbers.length; i++)
{
for (int j = 0; j < numbers[i].length; j++) {
System.out.println("Index: "+index);
array[index++] = numbers[i][j];
}
}
return array;
}
public static void sortieren(int[] numbers)
{
for (int i = 0; i < numbers.length -1; i++)
{
int aktuell = numbers[i];
int nachbar = numbers[i +1];
if(aktuell > nachbar)
{
numbers[i + 1] = aktuell;
numbers[i] = nachbar;
sortieren(numbers);
}
}
}
}
| 1,985 | 0.500504 | 0.482863 | 103 | 18.262136 | 17.162252 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.902913 | false | false | 15 |
575e9ac58a987ff7d68836557a2fbcc28f0dbca5 | 27,393,301,419,173 | 6fb5208295e1a01d89ff05ece221d5cb1428ff85 | /app/src/main/java/me/scraplesh/potions/core/cards/ICard.java | 6979dc1d5399f1561da72112e591a12ac8ce6205 | [] | no_license | scraplesh/Potions-Android | https://github.com/scraplesh/Potions-Android | 3bb2f514007ddadb8381ac0be8952d4f14dd62ca | fa0e2bce32afb7c15ab961c3a25b5a2b535b09bc | refs/heads/master | 2015-09-26T00:29:17.481000 | 2015-08-31T14:40:32 | 2015-08-31T14:40:32 | 41,680,776 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package me.scraplesh.potions.core.cards;
import android.graphics.Bitmap;
public interface ICard {
public String getName();
public Bitmap getImage();
}
| UTF-8 | Java | 162 | java | ICard.java | Java | [] | null | [] | package me.scraplesh.potions.core.cards;
import android.graphics.Bitmap;
public interface ICard {
public String getName();
public Bitmap getImage();
}
| 162 | 0.740741 | 0.740741 | 9 | 17 | 15.499104 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 14 |
1438a9a709decf2a9d016cf34a16b36efacb073e | 31,275,951,906,442 | 359afdd53f052f33bace081b73a725a9dc0b1e71 | /WEB-INF/classes/FirstGet.java | 05cac509125b60d2480effeb2080b84f6eb3e7ef | [] | no_license | Nero-Lijianhua/myodps | https://github.com/Nero-Lijianhua/myodps | 9e262a1c8ffb05a221ca6572a5c939834a55fdc3 | 721a65897eb133fff875febd9d51a2313df5d89e | refs/heads/master | 2016-09-11T06:08:29.864000 | 2015-06-19T01:30:54 | 2015-06-19T01:30:54 | 37,580,172 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FirstGet extends HttpServlet {
private static FileReader reader;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String sql = "select * from (select split_part(request, ' ', 2), count(*) as num from access_log group by split_part(request, ' ', 2))a order by num desc limit 100;";
Myodps mine = new Myodps();
out.println(mine.sendsql(sql));
out.close();
}
}
| UTF-8 | Java | 669 | java | FirstGet.java | Java | [] | null | [] | import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FirstGet extends HttpServlet {
private static FileReader reader;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String sql = "select * from (select split_part(request, ' ', 2), count(*) as num from access_log group by split_part(request, ' ', 2))a order by num desc limit 100;";
Myodps mine = new Myodps();
out.println(mine.sendsql(sql));
out.close();
}
}
| 669 | 0.660688 | 0.653214 | 18 | 36.166668 | 42.535278 | 174 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 14 |
c11e0ce3a034b3b015b6009d1951f8a43d8731cd | 22,033,182,293,395 | c12cadfb2f459b2e4fd331b507c538e4cebd3ffc | /Desafio/src/Main/Main.java | d2e142818bc33bc2f27510fdae8b4613e9460054 | [] | no_license | vilmar13/Teste-Esparta-Tecnologia-e-Inova-o- | https://github.com/vilmar13/Teste-Esparta-Tecnologia-e-Inova-o- | b95fae98d5342ba930e2384ff5a8d0176b9a0f5a | 38a84ef2fdc0332e4f59186dd686a35986bc6893 | refs/heads/master | 2021-08-23T11:00:31.630000 | 2017-12-04T16:15:13 | 2017-12-04T16:15:13 | 112,969,643 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Main;
import Controller.MainController;
public class Main {
public static void main(String[] args) {
MainController.getInstance().init();
}
}
| UTF-8 | Java | 160 | java | Main.java | Java | [] | null | [] | package Main;
import Controller.MainController;
public class Main {
public static void main(String[] args) {
MainController.getInstance().init();
}
}
| 160 | 0.71875 | 0.71875 | 13 | 11.307693 | 15.409211 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.538462 | false | false | 14 |
b3f0f949e1cdf17cd14413dd641261a2ad7d060e | 1,185,410,986,211 | 06cae5bb9578b9bffa43ae36b547a84a823938ea | /rms.aggService/src/main/java/com/hefei/agg/location/po/Location.java | a749e64f06dc26169179dcd00c6f381ded475e26 | [] | no_license | yefanflexi/crm | https://github.com/yefanflexi/crm | 43bf6ea725b00d7240a8a39abd8fe5fa6ffcc839 | 67b59d6a9eb6d5fba7b146a2e4f75e78423517a1 | refs/heads/master | 2020-07-16T20:19:26.770000 | 2017-12-25T09:21:48 | 2017-12-25T09:21:48 | 94,400,231 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hefei.agg.location.po;
import java.util.Date;
public class Location implements java.io.Serializable{
private static final long serialVersionUID = 2027775270232679636L;
private String code;
private String name;
private String enName;
private Long rank;
private String levelCode;
private String parentCode;
private Long status;
private String postCode;
private String dialingCode;
private String remark;
private Date createTime;
private Date updateTime;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
public Long getRank() {
return rank;
}
public void setRank(Long rank) {
this.rank = rank;
}
public String getLevelCode() {
return levelCode;
}
public void setLevelCode(String levelCode) {
this.levelCode = levelCode;
}
public String getParentCode() {
return parentCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public String getPostCode() {
return postCode;
}
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getDialingCode() {
return dialingCode;
}
public void setDialingCode(String dialingCode) {
this.dialingCode = dialingCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "Location [ code=" + code + ", name=" + name
+ ", enName=" + enName + ", rank=" + rank + ", levelCode="
+ levelCode + ", parentCode=" + parentCode + ", status="
+ status + ", postCode=" + postCode + ", dialingCode="
+ dialingCode + ", remark=" + remark + ", createTime="
+ createTime + ", updateTime=" + updateTime + "]";
}
}
| UTF-8 | Java | 2,533 | java | Location.java | Java | [] | null | [] | package com.hefei.agg.location.po;
import java.util.Date;
public class Location implements java.io.Serializable{
private static final long serialVersionUID = 2027775270232679636L;
private String code;
private String name;
private String enName;
private Long rank;
private String levelCode;
private String parentCode;
private Long status;
private String postCode;
private String dialingCode;
private String remark;
private Date createTime;
private Date updateTime;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
public Long getRank() {
return rank;
}
public void setRank(Long rank) {
this.rank = rank;
}
public String getLevelCode() {
return levelCode;
}
public void setLevelCode(String levelCode) {
this.levelCode = levelCode;
}
public String getParentCode() {
return parentCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public String getPostCode() {
return postCode;
}
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getDialingCode() {
return dialingCode;
}
public void setDialingCode(String dialingCode) {
this.dialingCode = dialingCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public String toString() {
return "Location [ code=" + code + ", name=" + name
+ ", enName=" + enName + ", rank=" + rank + ", levelCode="
+ levelCode + ", parentCode=" + parentCode + ", status="
+ status + ", postCode=" + postCode + ", dialingCode="
+ dialingCode + ", remark=" + remark + ", createTime="
+ createTime + ", updateTime=" + updateTime + "]";
}
}
| 2,533 | 0.67193 | 0.66443 | 106 | 21.896227 | 17.023252 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.830189 | false | false | 14 |
366329c5f2c5a88e8dbf73197bfa0885644c76d7 | 8,546,984,981,222 | 1cf89fa9264a8a6ff077cce9d9415d3e7405c949 | /maps4cim-gui/src/main/java/de/nx42/maps4cim/gui/window/UpdateWindow.java | 794a51222d4a3ba492a0cbb45b51488d1ae3e6ee | [
"Apache-2.0"
] | permissive | seewip/maps4cim | https://github.com/seewip/maps4cim | 7260d6767a4e1657cfa0f6ae53d4f7f52d6b7994 | 3787ffbfd911c8d27f5fc688b2f79b99d9689a88 | refs/heads/master | 2021-06-22T15:47:11.267000 | 2017-08-20T16:06:02 | 2017-08-20T16:06:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* maps4cim - a real world map generator for CiM 2
* Copyright 2013 Sebastian Straub
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.nx42.maps4cim.gui.window;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.ScrollPaneConstants;
import javax.swing.WindowConstants;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import de.nx42.maps4cim.gui.MainWindow;
import de.nx42.maps4cim.gui.util.Components;
import de.nx42.maps4cim.gui.util.Fonts;
import de.nx42.maps4cim.update.Update;
import de.nx42.maps4cim.update.Update.Release;
public class UpdateWindow extends JDialog {
private static final long serialVersionUID = 7546326133172584845L;
protected static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private Update update;
private Release release;
private final JPanel contentPanel = new JPanel();
public UpdateWindow(Window owner, Update update) {
super(owner);
this.update = update;
this.release = update.getBranch(SettingsWindow.getSelectedBranch());
setTitle(String.format("Update %s available", release.version));
setBounds(250, 200, 550, 480);
setMinimumSize(new Dimension(250, 150));
setLocationByPlatform(true);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
Components.setIconImages(this);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(contentPanel, BorderLayout.CENTER);
JEditorPane editorPaneAboutText = new JEditorPane();
editorPaneAboutText.setContentType("text/html");
editorPaneAboutText.setEditable(false);
editorPaneAboutText.setFont(Fonts.select(editorPaneAboutText.getFont(), "Tahoma", "Geneva", "Arial"));
editorPaneAboutText.setText(String.format("%s<html><br><a href=\"%s\">More Information</a><br><a href=\"%s\">Download</a></html>", release.description, release.infoUrl, release.downloadUrl));
editorPaneAboutText.addHyperlinkListener(hyperLinkListener);
JScrollPane scrollPane1 = new JScrollPane(editorPaneAboutText);
scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane1.setBorder(null);
final JScrollBar vScroll = scrollPane1.getVerticalScrollBar();
vScroll.setValue(vScroll.getMinimum());
JLabel lblAnUpdateIs = new JLabel(String.format("<html>An Update is available for maps4cim!\r\n<ul>\r\n<li>You are currently running <b>%s</b> (%s)</li>\r\n<li>The latest version of the <b>%s</b> branch is <b>%s</b> (released %s)</li>\r\n</ul>\r\nAbout this update:</html>",
MainWindow.version, MainWindow.branch, release.branch, release.version, sdf.format(release.releaseDate)));
JLabel lblWouldYouLike = new JLabel("Would you like to download the latest version now?");
GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
gl_contentPanel.setHorizontalGroup(
gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup()
.addContainerGap()
.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addComponent(lblAnUpdateIs)
.addComponent(lblWouldYouLike))
.addContainerGap())
);
gl_contentPanel.setVerticalGroup(
gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup()
.addContainerGap()
.addComponent(lblAnUpdateIs)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(lblWouldYouLike)
.addGap(6))
);
contentPanel.setLayout(gl_contentPanel);
JPanel buttonPane = new JPanel();
FlowLayout fl_buttonPane = new FlowLayout(FlowLayout.TRAILING);
buttonPane.setLayout(fl_buttonPane);
getContentPane().add(buttonPane, BorderLayout.SOUTH);
JButton btnOk = new JButton("OK");
Components.setPreferredWidth(btnOk, 70);
btnOk.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MainWindow.openWeb(release.downloadUrl);
dispose();
}
});
buttonPane.add(btnOk);
getRootPane().setDefaultButton(btnOk);
JButton btnCancel = new JButton("Cancel");
btnCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}
});
Components.setPreferredWidth(btnCancel, 70);
buttonPane.add(btnCancel);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
vScroll.setValue(vScroll.getMinimum());
}
});
}
protected HyperlinkListener hyperLinkListener = new HyperlinkListener() {
@Override
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(evt.getEventType())) {
MainWindow.openWeb(evt.getURL());
}
}
};
}
| UTF-8 | Java | 6,762 | java | UpdateWindow.java | Java | [
{
"context": "al world map generator for CiM 2\n * Copyright 2013 Sebastian Straub\n *\n * Licensed under the Apache License, Version ",
"end": 89,
"score": 0.9998537302017212,
"start": 73,
"tag": "NAME",
"value": "Sebastian Straub"
}
] | null | [] | /**
* maps4cim - a real world map generator for CiM 2
* Copyright 2013 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.nx42.maps4cim.gui.window;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.ScrollPaneConstants;
import javax.swing.WindowConstants;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import de.nx42.maps4cim.gui.MainWindow;
import de.nx42.maps4cim.gui.util.Components;
import de.nx42.maps4cim.gui.util.Fonts;
import de.nx42.maps4cim.update.Update;
import de.nx42.maps4cim.update.Update.Release;
public class UpdateWindow extends JDialog {
private static final long serialVersionUID = 7546326133172584845L;
protected static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private Update update;
private Release release;
private final JPanel contentPanel = new JPanel();
public UpdateWindow(Window owner, Update update) {
super(owner);
this.update = update;
this.release = update.getBranch(SettingsWindow.getSelectedBranch());
setTitle(String.format("Update %s available", release.version));
setBounds(250, 200, 550, 480);
setMinimumSize(new Dimension(250, 150));
setLocationByPlatform(true);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
Components.setIconImages(this);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(contentPanel, BorderLayout.CENTER);
JEditorPane editorPaneAboutText = new JEditorPane();
editorPaneAboutText.setContentType("text/html");
editorPaneAboutText.setEditable(false);
editorPaneAboutText.setFont(Fonts.select(editorPaneAboutText.getFont(), "Tahoma", "Geneva", "Arial"));
editorPaneAboutText.setText(String.format("%s<html><br><a href=\"%s\">More Information</a><br><a href=\"%s\">Download</a></html>", release.description, release.infoUrl, release.downloadUrl));
editorPaneAboutText.addHyperlinkListener(hyperLinkListener);
JScrollPane scrollPane1 = new JScrollPane(editorPaneAboutText);
scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane1.setBorder(null);
final JScrollBar vScroll = scrollPane1.getVerticalScrollBar();
vScroll.setValue(vScroll.getMinimum());
JLabel lblAnUpdateIs = new JLabel(String.format("<html>An Update is available for maps4cim!\r\n<ul>\r\n<li>You are currently running <b>%s</b> (%s)</li>\r\n<li>The latest version of the <b>%s</b> branch is <b>%s</b> (released %s)</li>\r\n</ul>\r\nAbout this update:</html>",
MainWindow.version, MainWindow.branch, release.branch, release.version, sdf.format(release.releaseDate)));
JLabel lblWouldYouLike = new JLabel("Would you like to download the latest version now?");
GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
gl_contentPanel.setHorizontalGroup(
gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup()
.addContainerGap()
.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addComponent(lblAnUpdateIs)
.addComponent(lblWouldYouLike))
.addContainerGap())
);
gl_contentPanel.setVerticalGroup(
gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup()
.addContainerGap()
.addComponent(lblAnUpdateIs)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(lblWouldYouLike)
.addGap(6))
);
contentPanel.setLayout(gl_contentPanel);
JPanel buttonPane = new JPanel();
FlowLayout fl_buttonPane = new FlowLayout(FlowLayout.TRAILING);
buttonPane.setLayout(fl_buttonPane);
getContentPane().add(buttonPane, BorderLayout.SOUTH);
JButton btnOk = new JButton("OK");
Components.setPreferredWidth(btnOk, 70);
btnOk.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MainWindow.openWeb(release.downloadUrl);
dispose();
}
});
buttonPane.add(btnOk);
getRootPane().setDefaultButton(btnOk);
JButton btnCancel = new JButton("Cancel");
btnCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}
});
Components.setPreferredWidth(btnCancel, 70);
buttonPane.add(btnCancel);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
vScroll.setValue(vScroll.getMinimum());
}
});
}
protected HyperlinkListener hyperLinkListener = new HyperlinkListener() {
@Override
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(evt.getEventType())) {
MainWindow.openWeb(evt.getURL());
}
}
};
}
| 6,752 | 0.686335 | 0.673913 | 163 | 40.484661 | 35.306087 | 282 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.803681 | false | false | 14 |
b2b76828ae44ecb048dd7f827c16ebe95971958c | 12,687,333,461,632 | 8ab68a2e040ad9d2c442420018ce5929d4d6d6e6 | /src/main/java/com/accp/controller/UserController.java | ed0fdb6901a2f98166cb99ac37f6aa7be40bdbda | [] | no_license | dsazdasdasdafa/aaaaa | https://github.com/dsazdasdasdafa/aaaaa | 383f2de326cb92fa21091b8328de12a37ed6b487 | 1edb2f71b905c297e38c4bc3d65d1a59dd7ef8fa | refs/heads/master | 2021-08-22T11:31:48.417000 | 2017-11-30T03:26:56 | 2017-11-30T03:26:56 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.accp.controller;
import com.accp.com.accp.entity.UserMessage;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Controller
public class UserController {
@RequestMapping(value = "/showJson")
public String showJson(HttpServletResponse resp) throws IOException {
resp.setContentType("text/html;charset=utf-8");
PrintWriter out = resp.getWriter();
//{"error":1,"message":"出错了"}
out.print("{\"error\":1,\"message\":\"出错了\"}");
out.flush();
out.close();
return null;
}
@RequestMapping(value = "/showJson2",produces = {"application/json;charset=utf-8"})
@ResponseBody
public String showJson2(){
return "{\"error\":1,\"message\":\"出错了\"}";
}
@RequestMapping(value = "/showJson3")
@ResponseBody
public String showJson3(){
return "{\"error\":1,\"message\":\"出错了\"}";
}
@RequestMapping(value = "/showJson4")
public @ResponseBody String showJson4(){
return JSON.toJSONString(new UserMessage(1,"出错了"));
}
@RequestMapping(value = "/showJson5")
@ResponseBody
public Object showJson5(){
return new UserMessage(1,"出错了");
}
}
| UTF-8 | Java | 1,486 | java | UserController.java | Java | [] | null | [] | package com.accp.controller;
import com.accp.com.accp.entity.UserMessage;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Controller
public class UserController {
@RequestMapping(value = "/showJson")
public String showJson(HttpServletResponse resp) throws IOException {
resp.setContentType("text/html;charset=utf-8");
PrintWriter out = resp.getWriter();
//{"error":1,"message":"出错了"}
out.print("{\"error\":1,\"message\":\"出错了\"}");
out.flush();
out.close();
return null;
}
@RequestMapping(value = "/showJson2",produces = {"application/json;charset=utf-8"})
@ResponseBody
public String showJson2(){
return "{\"error\":1,\"message\":\"出错了\"}";
}
@RequestMapping(value = "/showJson3")
@ResponseBody
public String showJson3(){
return "{\"error\":1,\"message\":\"出错了\"}";
}
@RequestMapping(value = "/showJson4")
public @ResponseBody String showJson4(){
return JSON.toJSONString(new UserMessage(1,"出错了"));
}
@RequestMapping(value = "/showJson5")
@ResponseBody
public Object showJson5(){
return new UserMessage(1,"出错了");
}
}
| 1,486 | 0.666207 | 0.655172 | 49 | 28.591837 | 22.156141 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false | 14 |
57944b3073824db0b4d55c7d3a36fd47480acdf4 | 20,847,771,265,618 | 4fb86b273ea8624579fb86f7057d5cf1f5c47aa6 | /dmcs_reports/src/main/java/com/bsva/dmcs/file/reports/HeaderRecord.java | 89fcdbbc3bcf4ff182c4ab871d2210be1a0725f2 | [] | no_license | dtekeshe/interbank_file_exchange | https://github.com/dtekeshe/interbank_file_exchange | fed233487d4c1cce3b3e014bdae1a4fee2d155be | ccf5ebe87c889f46ec01aef616a5d6552ee2ebaa | refs/heads/master | 2020-05-04T15:29:44.049000 | 2019-04-08T06:42:32 | 2019-04-08T06:42:32 | 179,243,300 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.bsva.dmcs.file.reports;
import java.math.BigDecimal;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author AugustineA
*
*/
public class HeaderRecord {
private String recorIdentifier;
private String outputDate;
private String serviceType;
private String subservice;
private String bankMemberNumber;
private String originator;
private String fileName;
private String fileNumber;
private String dataType;
private String dataDirection;
private String settlementDate;
private String testLive;
private String recordSize;
private String filler;
public HeaderRecord() {
}
public String getRecorIdentifier() {
return recorIdentifier;
}
public void setRecorIdentifier(String recorIdentifier) {
this.recorIdentifier = recorIdentifier;
}
public String getOutputDate() {
return outputDate;
}
public void setOutputDate(String outputDate) {
this.outputDate = outputDate;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getSubservice() {
return subservice;
}
public void setSubservice(String subservice) {
this.subservice = subservice;
}
public String getBankMemberNumber() {
return bankMemberNumber;
}
public void setBankMemberNumber(String bankMemberNumber) {
this.bankMemberNumber = bankMemberNumber;
}
public String getOriginator() {
return originator;
}
public void setOriginator(String originator) {
this.originator = originator;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileNumber() {
return fileNumber;
}
public void setFileNumber(String fileNumber) {
this.fileNumber = fileNumber;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataDirection() {
return dataDirection;
}
public void setDataDirection(String dataDirection) {
this.dataDirection = dataDirection;
}
public String getSettlementDate() {
return settlementDate;
}
public void setSettlementDate(String settlementDate) {
this.settlementDate = settlementDate;
}
public String getTestLive() {
return testLive;
}
public void setTestLive(String testLive) {
this.testLive = testLive;
}
public String getRecordSize() {
return recordSize;
}
public void setRecordSize(String recordSize) {
this.recordSize = recordSize;
}
public String getFiller() {
return filler;
}
public void setFiller(String filler) {
this.filler = filler;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
//Header Formatting
//builder.append(settleDetailInd == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(settleDetailInd,1).replace(" "," "));
builder.append(recorIdentifier == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(recorIdentifier,1).replace(" "," "));
builder.append(outputDate == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(outputDate,1).replace(" "," "));
builder.append(serviceType == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(serviceType,1).replace(" "," "));
builder.append(subservice == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(subservice,1).replace(" "," "));
builder.append(bankMemberNumber == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(bankMemberNumber,1).replace(" "," "));
builder.append(originator == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(originator,1).replace(" "," "));
builder.append(fileName == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(fileName,1).replace(" "," "));
builder.append(fileNumber == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(fileNumber,1).replace(" "," "));
builder.append(dataType == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(dataType,1).replace(" "," "));
builder.append(dataDirection == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(dataDirection,1).replace(" "," "));
builder.append(settlementDate == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(settlementDate,1).replace(" "," "));
builder.append(testLive == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(testLive,1).replace(" "," "));
builder.append(recordSize == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(recordSize,1).replace(" "," "));
builder.append(filler == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(filler,1).replace(" "," "));
return builder.toString();
}
public static String leftJustifyWithZeros(String s, int length) {
if (s.length() >= length) return s;
else return String.format("%0" + (length-s.length()) + "d%s", 0, s);
}
public static String leftJustifyWithSpaces(String s, int length) {
if (s.length() >= length) return s;
else return String.format("%"+ (length-s.length()) +"s", s);
}
public static String doubleToStringCommaReplacer(Long l) {
return String.format("%.2f", l).replace(".", "");
}
public static String getTime(){
Date date = new Date();
Format formatter = new SimpleDateFormat("HH:mm:ss");
String s = formatter.format(date);
String[] splist =s.split(":");
String hour = splist[0];
String minutes = splist[1];
String seconds = splist[2];
return leftJustifyWithZeros(hour,2) + minutes + seconds;
}
public static boolean isEmpty(String str) {
return str == null || str.length() == 0;
}
/**
* @param str
* @param num
* @return
*/
public static String rightPadZeros(String str, int num) {
return String.format("%1$-" + num + "s", str).replace(' ', ' ');
}
/**
* @param str
* @param num
* @return
*/
public static String rightPadding(String str, int num) {
return String.format("%1$-" + num + "s", str);
}
/**
* @param s
* @param n
* @return
*/
public static String padLeft(String s, int n) {
return String.format("%1$" + n + "s", s);
}
/**
* @param s
* @param n
* @return
*/
public static String padLeftString(String s, int n) {
return String.format("%0$"+ n +"s", s);
}
/**
* @param s
* @param n
* @return
*/
public static String paddingLeft(String s, int n) {
return String.format("%1$"+ n + "s", s);
}
/**
* @param str
* @return
*/
public static String Convert(String str) {
BigDecimal payments = new BigDecimal(str);
BigDecimal payments2 = new BigDecimal("100");
String str1 = String.format("%.2f",payments.multiply(payments2)).replace('.','0').substring(0,6);
return str1 ;
}
/**
* @param str
* @return
*/
public static String Converter(String str){
BigDecimal payments3 = new BigDecimal(str);
BigDecimal payments24= new BigDecimal("100");
payments3.toBigInteger().toString();
String str1 = paddingLeft(String.format("%.2f",payments3.multiply(payments24)),16).replace('.',' ').substring(0, 14);
String str3 = str1;
return paddingLeft(str3,17).substring(0, 16);
}
/**
* @param str
* @return
*/
public static String Converter1(String str){
BigDecimal payments3 = new BigDecimal(str);
BigDecimal payments24= new BigDecimal("100");
payments3.toBigInteger().toString();
String str1 = paddingLeft(String.format("%.2f",payments3.multiply(payments24)),16).replace('.',' ').substring(0, 14);
String str3 = str1;
return paddingLeft(str3,17).substring(0, 16).replace(' ', '0');
}
}
| UTF-8 | Java | 7,663 | java | HeaderRecord.java | Java | [
{
"context": "ateFormat;\nimport java.util.Date;\n\n\n/**\n * @author AugustineA\n *\n */\npublic class HeaderRecord {\n\n\t\n\tprivate St",
"end": 176,
"score": 0.8923673629760742,
"start": 166,
"tag": "NAME",
"value": "AugustineA"
}
] | null | [] | package com.bsva.dmcs.file.reports;
import java.math.BigDecimal;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author AugustineA
*
*/
public class HeaderRecord {
private String recorIdentifier;
private String outputDate;
private String serviceType;
private String subservice;
private String bankMemberNumber;
private String originator;
private String fileName;
private String fileNumber;
private String dataType;
private String dataDirection;
private String settlementDate;
private String testLive;
private String recordSize;
private String filler;
public HeaderRecord() {
}
public String getRecorIdentifier() {
return recorIdentifier;
}
public void setRecorIdentifier(String recorIdentifier) {
this.recorIdentifier = recorIdentifier;
}
public String getOutputDate() {
return outputDate;
}
public void setOutputDate(String outputDate) {
this.outputDate = outputDate;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getSubservice() {
return subservice;
}
public void setSubservice(String subservice) {
this.subservice = subservice;
}
public String getBankMemberNumber() {
return bankMemberNumber;
}
public void setBankMemberNumber(String bankMemberNumber) {
this.bankMemberNumber = bankMemberNumber;
}
public String getOriginator() {
return originator;
}
public void setOriginator(String originator) {
this.originator = originator;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileNumber() {
return fileNumber;
}
public void setFileNumber(String fileNumber) {
this.fileNumber = fileNumber;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataDirection() {
return dataDirection;
}
public void setDataDirection(String dataDirection) {
this.dataDirection = dataDirection;
}
public String getSettlementDate() {
return settlementDate;
}
public void setSettlementDate(String settlementDate) {
this.settlementDate = settlementDate;
}
public String getTestLive() {
return testLive;
}
public void setTestLive(String testLive) {
this.testLive = testLive;
}
public String getRecordSize() {
return recordSize;
}
public void setRecordSize(String recordSize) {
this.recordSize = recordSize;
}
public String getFiller() {
return filler;
}
public void setFiller(String filler) {
this.filler = filler;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
//Header Formatting
//builder.append(settleDetailInd == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(settleDetailInd,1).replace(" "," "));
builder.append(recorIdentifier == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(recorIdentifier,1).replace(" "," "));
builder.append(outputDate == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(outputDate,1).replace(" "," "));
builder.append(serviceType == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(serviceType,1).replace(" "," "));
builder.append(subservice == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(subservice,1).replace(" "," "));
builder.append(bankMemberNumber == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(bankMemberNumber,1).replace(" "," "));
builder.append(originator == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(originator,1).replace(" "," "));
builder.append(fileName == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(fileName,1).replace(" "," "));
builder.append(fileNumber == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(fileNumber,1).replace(" "," "));
builder.append(dataType == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(dataType,1).replace(" "," "));
builder.append(dataDirection == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(dataDirection,1).replace(" "," "));
builder.append(settlementDate == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(settlementDate,1).replace(" "," "));
builder.append(testLive == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(testLive,1).replace(" "," "));
builder.append(recordSize == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(recordSize,1).replace(" "," "));
builder.append(filler == null ? rightPadding(" ",1).replace(" ","0") :rightPadding(filler,1).replace(" "," "));
return builder.toString();
}
public static String leftJustifyWithZeros(String s, int length) {
if (s.length() >= length) return s;
else return String.format("%0" + (length-s.length()) + "d%s", 0, s);
}
public static String leftJustifyWithSpaces(String s, int length) {
if (s.length() >= length) return s;
else return String.format("%"+ (length-s.length()) +"s", s);
}
public static String doubleToStringCommaReplacer(Long l) {
return String.format("%.2f", l).replace(".", "");
}
public static String getTime(){
Date date = new Date();
Format formatter = new SimpleDateFormat("HH:mm:ss");
String s = formatter.format(date);
String[] splist =s.split(":");
String hour = splist[0];
String minutes = splist[1];
String seconds = splist[2];
return leftJustifyWithZeros(hour,2) + minutes + seconds;
}
public static boolean isEmpty(String str) {
return str == null || str.length() == 0;
}
/**
* @param str
* @param num
* @return
*/
public static String rightPadZeros(String str, int num) {
return String.format("%1$-" + num + "s", str).replace(' ', ' ');
}
/**
* @param str
* @param num
* @return
*/
public static String rightPadding(String str, int num) {
return String.format("%1$-" + num + "s", str);
}
/**
* @param s
* @param n
* @return
*/
public static String padLeft(String s, int n) {
return String.format("%1$" + n + "s", s);
}
/**
* @param s
* @param n
* @return
*/
public static String padLeftString(String s, int n) {
return String.format("%0$"+ n +"s", s);
}
/**
* @param s
* @param n
* @return
*/
public static String paddingLeft(String s, int n) {
return String.format("%1$"+ n + "s", s);
}
/**
* @param str
* @return
*/
public static String Convert(String str) {
BigDecimal payments = new BigDecimal(str);
BigDecimal payments2 = new BigDecimal("100");
String str1 = String.format("%.2f",payments.multiply(payments2)).replace('.','0').substring(0,6);
return str1 ;
}
/**
* @param str
* @return
*/
public static String Converter(String str){
BigDecimal payments3 = new BigDecimal(str);
BigDecimal payments24= new BigDecimal("100");
payments3.toBigInteger().toString();
String str1 = paddingLeft(String.format("%.2f",payments3.multiply(payments24)),16).replace('.',' ').substring(0, 14);
String str3 = str1;
return paddingLeft(str3,17).substring(0, 16);
}
/**
* @param str
* @return
*/
public static String Converter1(String str){
BigDecimal payments3 = new BigDecimal(str);
BigDecimal payments24= new BigDecimal("100");
payments3.toBigInteger().toString();
String str1 = paddingLeft(String.format("%.2f",payments3.multiply(payments24)),16).replace('.',' ').substring(0, 14);
String str3 = str1;
return paddingLeft(str3,17).substring(0, 16).replace(' ', '0');
}
}
| 7,663 | 0.666841 | 0.651051 | 307 | 23.960913 | 30.716818 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.677524 | false | false | 14 |
df2d6883504c52bb65df6771ddfbbc3130d12f22 | 6,562,710,043,991 | 33b32d556419a5f385885836348df74eeb28bd2a | /Plane/DJ's Wingman/JieDONG-Wingman/src/CollidableObject/Munitions.java | 8c9ce4a06ab5b36443a3ea6c444ad7e67ec2ad92 | [] | no_license | JieD/TankWar-Wingman | https://github.com/JieD/TankWar-Wingman | b3084ea78d5402c0c1123cd4c95e26e51f4bd189 | 95cb98418123a47585f5a412b4a65cb765a581aa | refs/heads/master | 2021-01-10T16:36:25.252000 | 2016-02-28T22:26:32 | 2016-02-28T22:26:32 | 52,744,971 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package CollidableObject;
import Helper.Explosion;
import Helper.Property;
import Weapon.Weapon;
import java.awt.Image;
import wingman.Wingman;
/**
* Munitions represents any CollidableObject that can only hurt its enemies by
* collision. Munitions cannot fire bullet.
* If it collides with its enemy, MyPlane and MyBullet, it explodes.
* It is created with 3 constructor:
* 1) created by the programmer (speed and direction manually passed in)
* e.g: EnemyPlaneDown, EnemyPlaneUp, EnemyPlaneLeft, EnemyPlaneRight
* 2) created by a Weapon(direction manually passed in, speed is twice of Weapon's)
* e.g: EnemyBullet, MyBulletUp, MyBulletLeft, MyBulletRight
*/
public class Munitions extends CollidableObject {
private Weapon owner = null;
// created by the programmer
public Munitions(int x, int y, int speed, Property property, Image image,
Explosion explosion) {
super(x, y, speed, property, image, explosion);
}
// created by a Weapon
public Munitions(Property property, Image image, Explosion explosion, Weapon owner) {
this(owner.getX(), owner.getY(), 2 * owner.getSpeed(), property, image,
explosion);
if (property.getDirection() < 0) setDirection(owner.getDirection());
if(owner.getSpeed() == 0) setSpeed(2 * Wingman.SPEED);
this.owner = owner;
}
@Override
public void collide(CollidableObject another) {
if(owner != null) {
//System.out.println(getName() + ": " + getEnemyList());
//System.out.println(getName() + " hits " + another.getName());
owner.hit(another);
} else {
//System.out.println(getName() + " hits " + another.getName());
}
explode();
}
public Weapon getOwner() {
return owner;
}
}
| UTF-8 | Java | 1,886 | java | Munitions.java | Java | [] | null | [] |
package CollidableObject;
import Helper.Explosion;
import Helper.Property;
import Weapon.Weapon;
import java.awt.Image;
import wingman.Wingman;
/**
* Munitions represents any CollidableObject that can only hurt its enemies by
* collision. Munitions cannot fire bullet.
* If it collides with its enemy, MyPlane and MyBullet, it explodes.
* It is created with 3 constructor:
* 1) created by the programmer (speed and direction manually passed in)
* e.g: EnemyPlaneDown, EnemyPlaneUp, EnemyPlaneLeft, EnemyPlaneRight
* 2) created by a Weapon(direction manually passed in, speed is twice of Weapon's)
* e.g: EnemyBullet, MyBulletUp, MyBulletLeft, MyBulletRight
*/
public class Munitions extends CollidableObject {
private Weapon owner = null;
// created by the programmer
public Munitions(int x, int y, int speed, Property property, Image image,
Explosion explosion) {
super(x, y, speed, property, image, explosion);
}
// created by a Weapon
public Munitions(Property property, Image image, Explosion explosion, Weapon owner) {
this(owner.getX(), owner.getY(), 2 * owner.getSpeed(), property, image,
explosion);
if (property.getDirection() < 0) setDirection(owner.getDirection());
if(owner.getSpeed() == 0) setSpeed(2 * Wingman.SPEED);
this.owner = owner;
}
@Override
public void collide(CollidableObject another) {
if(owner != null) {
//System.out.println(getName() + ": " + getEnemyList());
//System.out.println(getName() + " hits " + another.getName());
owner.hit(another);
} else {
//System.out.println(getName() + " hits " + another.getName());
}
explode();
}
public Weapon getOwner() {
return owner;
}
}
| 1,886 | 0.635207 | 0.631495 | 52 | 34.23077 | 27.713934 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.865385 | false | false | 14 |
86860b1daac046cc160589b9dd3f5741130a9335 | 5,540,507,882,055 | 489a56de7fce32f0c5fdcfa916da891047c7712b | /gewara-new/src/main/java/com/gewara/helper/DramaHelper.java | 6a925c12449580220060762d8f00445b6586ed43 | [] | no_license | xie-summer/GWR | https://github.com/xie-summer/GWR | f5506ea6f41800788463e33377d34ebefca21c01 | 0894221d00edfced294f1f061c9f9e6aa8d51617 | refs/heads/master | 2021-06-22T04:45:17.720000 | 2017-06-15T09:48:32 | 2017-06-15T09:48:32 | 89,137,292 | 2 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.gewara.helper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.gewara.model.drama.Drama;
import com.gewara.util.BeanUtil;
public abstract class DramaHelper implements Serializable {
private static final long serialVersionUID = -3810605886869730408L;
private static boolean excludeDramaByDate(Drama drama, Date date){
if(date == null) return true;
final boolean releasedate = drama.getReleasedate() == null;
final boolean enddate = drama.getEnddate() == null;
if(releasedate && enddate){
return true;
}
return releasedate && date.before(drama.getEnddate())
|| enddate && date.after(drama.getReleasedate())
|| date.after(drama.getReleasedate()) && date.before(drama.getEnddate());
}
private static boolean excludeDramaByStarid(Drama drama, Long starid){
if(starid == null) return true;
if(StringUtils.isBlank(drama.getActors())) return false;
List<Long> idList = BeanUtil.getIdList(drama.getActors(), ",");
if(idList.isEmpty()) return false;
return idList.contains(starid);
}
private static boolean excludeDramaByPrice(Drama drama, Integer minprice, Integer maxprice){
final boolean minFlag = (minprice == null), maxFlag = (maxprice == null);
if( minFlag && maxFlag) return true;
if(StringUtils.isBlank(drama.getPrices())) return false;
List<Integer> priceList = BeanUtil.getIntgerList(drama.getPrices(), ",");
if(priceList.isEmpty()) return false;
for (Integer price : priceList) {
if(minFlag && price >= maxprice
|| maxFlag && price <= minprice
|| (!minFlag && !maxFlag && price>= minprice && price <= maxprice)){
return true;
}
}
return false;
}
public static List<Drama> dateFilter(List<Drama> dramaList, Date date){
if(date == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByDate(drama, date)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> dramaStarFilter(List<Drama> dramaList, Long starid){
if(starid == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByStarid(drama, starid)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> priceFilter(List<Drama> dramaList, Integer minprice, Integer maxprice){
if(minprice == null && maxprice == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByPrice(drama, minprice, maxprice)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> dramaListFilter(List<Drama> dramaList, Date date, Long starid, Integer minprice, Integer maxprice){
if(date == null && starid == null && minprice == null && maxprice == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByDate(drama, date)
&& excludeDramaByStarid(drama, starid)
&& excludeDramaByPrice(drama, minprice, maxprice)){
tmpList.add(drama);
}
}
return tmpList;
}
}
| UTF-8 | Java | 3,255 | java | DramaHelper.java | Java | [] | null | [] | package com.gewara.helper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.gewara.model.drama.Drama;
import com.gewara.util.BeanUtil;
public abstract class DramaHelper implements Serializable {
private static final long serialVersionUID = -3810605886869730408L;
private static boolean excludeDramaByDate(Drama drama, Date date){
if(date == null) return true;
final boolean releasedate = drama.getReleasedate() == null;
final boolean enddate = drama.getEnddate() == null;
if(releasedate && enddate){
return true;
}
return releasedate && date.before(drama.getEnddate())
|| enddate && date.after(drama.getReleasedate())
|| date.after(drama.getReleasedate()) && date.before(drama.getEnddate());
}
private static boolean excludeDramaByStarid(Drama drama, Long starid){
if(starid == null) return true;
if(StringUtils.isBlank(drama.getActors())) return false;
List<Long> idList = BeanUtil.getIdList(drama.getActors(), ",");
if(idList.isEmpty()) return false;
return idList.contains(starid);
}
private static boolean excludeDramaByPrice(Drama drama, Integer minprice, Integer maxprice){
final boolean minFlag = (minprice == null), maxFlag = (maxprice == null);
if( minFlag && maxFlag) return true;
if(StringUtils.isBlank(drama.getPrices())) return false;
List<Integer> priceList = BeanUtil.getIntgerList(drama.getPrices(), ",");
if(priceList.isEmpty()) return false;
for (Integer price : priceList) {
if(minFlag && price >= maxprice
|| maxFlag && price <= minprice
|| (!minFlag && !maxFlag && price>= minprice && price <= maxprice)){
return true;
}
}
return false;
}
public static List<Drama> dateFilter(List<Drama> dramaList, Date date){
if(date == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByDate(drama, date)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> dramaStarFilter(List<Drama> dramaList, Long starid){
if(starid == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByStarid(drama, starid)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> priceFilter(List<Drama> dramaList, Integer minprice, Integer maxprice){
if(minprice == null && maxprice == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByPrice(drama, minprice, maxprice)) tmpList.add(drama);
}
return tmpList;
}
public static List<Drama> dramaListFilter(List<Drama> dramaList, Date date, Long starid, Integer minprice, Integer maxprice){
if(date == null && starid == null && minprice == null && maxprice == null) return dramaList;
List<Drama> tmpList = new ArrayList<Drama>();
for (Drama drama : dramaList) {
if(excludeDramaByDate(drama, date)
&& excludeDramaByStarid(drama, starid)
&& excludeDramaByPrice(drama, minprice, maxprice)){
tmpList.add(drama);
}
}
return tmpList;
}
}
| 3,255 | 0.69278 | 0.686943 | 91 | 33.76923 | 28.465162 | 126 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.505495 | false | false | 14 |
aa0c27a3badff9c40dfbf1b53382b9621588f516 | 15,668,040,697,638 | 04c445715e995647ce2a4d6f646c343bbb9c04d5 | /app/src/main/java/com/franklinho/ridecell/models/ParkingLocation.java | c220b27be262f1ebb1f0fda136dd800b94138d80 | [] | no_license | franklinho/RideCellParking | https://github.com/franklinho/RideCellParking | bf6003f14134e41a82105f635f88535bbf4e8536 | 0d501ba9e073de70f616ec167cca675804d82198 | refs/heads/master | 2021-01-01T05:43:41.643000 | 2016-05-27T06:07:04 | 2016-05-27T06:07:04 | 59,807,819 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.franklinho.ridecell.models;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import org.json.JSONArray;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.List;
public class ParkingLocation implements Parcelable {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("lat")
@Expose
private String lat;
@SerializedName("lng")
@Expose
private String lng;
@SerializedName("name")
@Expose
private String name;
@SerializedName("cost_per_minute")
@Expose
private String costPerMinute;
@SerializedName("max_reserve_time_mins")
@Expose
private Integer maxReserveTimeMins;
@SerializedName("min_reserve_time_mins")
@Expose
private Integer minReserveTimeMins;
@SerializedName("is_reserved")
@Expose
private Boolean isReserved;
@SerializedName("reserved_until")
@Expose
private String reservedUntil;
/**
*
* @return
* The id
*/
public Integer getId() {
return id;
}
/**
*
* @param id
* The id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
* @return
* The lat
*/
public String getLat() {
return lat;
}
/**
*
* @param lat
* The lat
*/
public void setLat(String lat) {
this.lat = lat;
}
/**
*
* @return
* The lng
*/
public String getLng() {
return lng;
}
/**
*
* @param lng
* The lng
*/
public void setLng(String lng) {
this.lng = lng;
}
/**
*
* @return
* The name
*/
public String getName() {
return name;
}
/**
*
* @param name
* The name
*/
public void setName(String name) {
this.name = name;
}
/**
*
* @return
* The costPerMinute
*/
public String getCostPerMinute() {
return costPerMinute;
}
/**
*
* @param costPerMinute
* The cost_per_minute
*/
public void setCostPerMinute(String costPerMinute) {
this.costPerMinute = costPerMinute;
}
/**
*
* @return
* The maxReserveTimeMins
*/
public Integer getMaxReserveTimeMins() {
return maxReserveTimeMins;
}
/**
*
* @param maxReserveTimeMins
* The max_reserve_time_mins
*/
public void setMaxReserveTimeMins(Integer maxReserveTimeMins) {
this.maxReserveTimeMins = maxReserveTimeMins;
}
/**
*
* @return
* The minReserveTimeMins
*/
public Integer getMinReserveTimeMins() {
return minReserveTimeMins;
}
/**
*
* @param minReserveTimeMins
* The min_reserve_time_mins
*/
public void setMinReserveTimeMins(Integer minReserveTimeMins) {
this.minReserveTimeMins = minReserveTimeMins;
}
/**
*
* @return
* The isReserved
*/
public Boolean getIsReserved() {
return isReserved;
}
/**
*
* @param isReserved
* The is_reserved
*/
public void setIsReserved(Boolean isReserved) {
this.isReserved = isReserved;
}
/**
*
* @return
* The reservedUntil
*/
public String getReservedUntil() {
return reservedUntil;
}
/**
*
* @param reservedUntil
* The reserved_until
*/
public void setReservedUntil(String reservedUntil) {
this.reservedUntil = reservedUntil;
}
public static List<ParkingLocation> fromJSONArray(JSONArray json) {
Type listType = new TypeToken<List<ParkingLocation>>() {}.getType();
Gson gson = new GsonBuilder().create();
return (List<ParkingLocation>) gson.fromJson(json.toString(), listType);
}
public static ParkingLocation fromJSONObject(JSONObject json) {
Gson gson = new GsonBuilder().create();
return (ParkingLocation) gson.fromJson(json.toString(), ParkingLocation.class);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(this.id);
dest.writeString(this.lat);
dest.writeString(this.lng);
dest.writeString(this.name);
dest.writeString(this.costPerMinute);
dest.writeValue(this.maxReserveTimeMins);
dest.writeValue(this.minReserveTimeMins);
dest.writeValue(this.isReserved);
dest.writeString(this.reservedUntil);
}
public ParkingLocation() {
}
protected ParkingLocation(Parcel in) {
this.id = (Integer) in.readValue(Integer.class.getClassLoader());
this.lat = in.readString();
this.lng = in.readString();
this.name = in.readString();
this.costPerMinute = in.readString();
this.maxReserveTimeMins = (Integer) in.readValue(Integer.class.getClassLoader());
this.minReserveTimeMins = (Integer) in.readValue(Integer.class.getClassLoader());
this.isReserved = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.reservedUntil = in.readString();
}
public static final Parcelable.Creator<ParkingLocation> CREATOR = new Parcelable.Creator<ParkingLocation>() {
@Override
public ParkingLocation createFromParcel(Parcel source) {
return new ParkingLocation(source);
}
@Override
public ParkingLocation[] newArray(int size) {
return new ParkingLocation[size];
}
};
}
| UTF-8 | Java | 5,911 | java | ParkingLocation.java | Java | [
{
"context": "package com.franklinho.ridecell.models;\n\n\nimport android.os.Parcel;\nimpo",
"end": 22,
"score": 0.6633951663970947,
"start": 14,
"tag": "USERNAME",
"value": "anklinho"
}
] | null | [] | package com.franklinho.ridecell.models;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import org.json.JSONArray;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.List;
public class ParkingLocation implements Parcelable {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("lat")
@Expose
private String lat;
@SerializedName("lng")
@Expose
private String lng;
@SerializedName("name")
@Expose
private String name;
@SerializedName("cost_per_minute")
@Expose
private String costPerMinute;
@SerializedName("max_reserve_time_mins")
@Expose
private Integer maxReserveTimeMins;
@SerializedName("min_reserve_time_mins")
@Expose
private Integer minReserveTimeMins;
@SerializedName("is_reserved")
@Expose
private Boolean isReserved;
@SerializedName("reserved_until")
@Expose
private String reservedUntil;
/**
*
* @return
* The id
*/
public Integer getId() {
return id;
}
/**
*
* @param id
* The id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
* @return
* The lat
*/
public String getLat() {
return lat;
}
/**
*
* @param lat
* The lat
*/
public void setLat(String lat) {
this.lat = lat;
}
/**
*
* @return
* The lng
*/
public String getLng() {
return lng;
}
/**
*
* @param lng
* The lng
*/
public void setLng(String lng) {
this.lng = lng;
}
/**
*
* @return
* The name
*/
public String getName() {
return name;
}
/**
*
* @param name
* The name
*/
public void setName(String name) {
this.name = name;
}
/**
*
* @return
* The costPerMinute
*/
public String getCostPerMinute() {
return costPerMinute;
}
/**
*
* @param costPerMinute
* The cost_per_minute
*/
public void setCostPerMinute(String costPerMinute) {
this.costPerMinute = costPerMinute;
}
/**
*
* @return
* The maxReserveTimeMins
*/
public Integer getMaxReserveTimeMins() {
return maxReserveTimeMins;
}
/**
*
* @param maxReserveTimeMins
* The max_reserve_time_mins
*/
public void setMaxReserveTimeMins(Integer maxReserveTimeMins) {
this.maxReserveTimeMins = maxReserveTimeMins;
}
/**
*
* @return
* The minReserveTimeMins
*/
public Integer getMinReserveTimeMins() {
return minReserveTimeMins;
}
/**
*
* @param minReserveTimeMins
* The min_reserve_time_mins
*/
public void setMinReserveTimeMins(Integer minReserveTimeMins) {
this.minReserveTimeMins = minReserveTimeMins;
}
/**
*
* @return
* The isReserved
*/
public Boolean getIsReserved() {
return isReserved;
}
/**
*
* @param isReserved
* The is_reserved
*/
public void setIsReserved(Boolean isReserved) {
this.isReserved = isReserved;
}
/**
*
* @return
* The reservedUntil
*/
public String getReservedUntil() {
return reservedUntil;
}
/**
*
* @param reservedUntil
* The reserved_until
*/
public void setReservedUntil(String reservedUntil) {
this.reservedUntil = reservedUntil;
}
public static List<ParkingLocation> fromJSONArray(JSONArray json) {
Type listType = new TypeToken<List<ParkingLocation>>() {}.getType();
Gson gson = new GsonBuilder().create();
return (List<ParkingLocation>) gson.fromJson(json.toString(), listType);
}
public static ParkingLocation fromJSONObject(JSONObject json) {
Gson gson = new GsonBuilder().create();
return (ParkingLocation) gson.fromJson(json.toString(), ParkingLocation.class);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(this.id);
dest.writeString(this.lat);
dest.writeString(this.lng);
dest.writeString(this.name);
dest.writeString(this.costPerMinute);
dest.writeValue(this.maxReserveTimeMins);
dest.writeValue(this.minReserveTimeMins);
dest.writeValue(this.isReserved);
dest.writeString(this.reservedUntil);
}
public ParkingLocation() {
}
protected ParkingLocation(Parcel in) {
this.id = (Integer) in.readValue(Integer.class.getClassLoader());
this.lat = in.readString();
this.lng = in.readString();
this.name = in.readString();
this.costPerMinute = in.readString();
this.maxReserveTimeMins = (Integer) in.readValue(Integer.class.getClassLoader());
this.minReserveTimeMins = (Integer) in.readValue(Integer.class.getClassLoader());
this.isReserved = (Boolean) in.readValue(Boolean.class.getClassLoader());
this.reservedUntil = in.readString();
}
public static final Parcelable.Creator<ParkingLocation> CREATOR = new Parcelable.Creator<ParkingLocation>() {
@Override
public ParkingLocation createFromParcel(Parcel source) {
return new ParkingLocation(source);
}
@Override
public ParkingLocation[] newArray(int size) {
return new ParkingLocation[size];
}
};
}
| 5,911 | 0.592624 | 0.592455 | 272 | 20.731617 | 20.255846 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.253676 | false | false | 14 |
05cc1def0344e8938d470e05a28a4039864bc835 | 31,370,441,163,269 | a09f3ffe4d26e5ba1c689f2e97feae9fad5b90b1 | /5.java | 2180321cd6647a168ff0d8ff2b8c598988b10f23 | [] | no_license | ShowerJu728/Homework | https://github.com/ShowerJu728/Homework | e357444e2486d7414ef4f799a5e9e71728bb0744 | ab1256c0eac93e34b7a4d303046b0924463586cb | refs/heads/master | 2020-03-29T19:20:44.807000 | 2018-10-24T10:05:00 | 2018-10-24T10:05:00 | 150,258,310 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("輸入三角形的三邊長");
Scanner a = new Scanner(System.in);
int Q = a.nextInt();
Scanner b = new Scanner(System.in);
int W = b.nextInt();
Scanner c = new Scanner(System.in);
int E = c.nextInt();
if (Q > W || W > E){
System.out.println("False");
}
else if (Q + W > E && W + E > Q && Q + E > W) {
System.out.println("True");
} else {
System.out.println("False");
}
}
}
| UTF-8 | Java | 649 | java | 5.java | Java | [] | null | [] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("輸入三角形的三邊長");
Scanner a = new Scanner(System.in);
int Q = a.nextInt();
Scanner b = new Scanner(System.in);
int W = b.nextInt();
Scanner c = new Scanner(System.in);
int E = c.nextInt();
if (Q > W || W > E){
System.out.println("False");
}
else if (Q + W > E && W + E > Q && Q + E > W) {
System.out.println("True");
} else {
System.out.println("False");
}
}
}
| 649 | 0.462758 | 0.462758 | 24 | 24.291666 | 17.360106 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.541667 | false | false | 14 |
5843e7d2e541f10b7b365c67eae59be803730d90 | 19,799,799,269,211 | e76dccc9d73b296a608d0c942ef8df8de830a020 | /src/main/java/net.frozenorb/qmodsuite/command/DespawnEntityCommand.java | 748067bb0886626ae35127f2e20ddca1b84ab630 | [
"MIT"
] | permissive | SkyHCF-Network/qModSuite | https://github.com/SkyHCF-Network/qModSuite | cba80b924ce54bc3051bd7f3a24ecc840bdce676 | 1bab9ec25333f6c94a0aa0a04b0c48f8e0483ed1 | refs/heads/main | 2023-06-15T09:12:47.898000 | 2021-07-13T16:59:51 | 2021-07-13T16:59:51 | 385,671,703 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.frozenorb.qmodsuite.command;
import net.frozenorb.qlib.command.Command;
import net.frozenorb.qlib.util.EntityUtils;
import net.frozenorb.qmodsuite.listeners.GeneralListener;
import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public final class DespawnEntityCommand {
@Command(
names = {"despawnentity"},
permission = "basic.staff"
)
public static void despawnentity(Player sender) {
if (!GeneralListener.getDespawn().containsKey(sender.getUniqueId())) {
sender.sendMessage(ChatColor.RED + "No entity to despawn.");
} else {
Entity entity = (Entity)GeneralListener.getDespawn().get(sender.getUniqueId());
GeneralListener.getDespawn().remove(sender.getUniqueId());
entity.remove();
sender.sendMessage(ChatColor.GOLD + "Successfully despawned the " + ChatColor.WHITE + EntityUtils.getName(entity.getType()) + ChatColor.GOLD + ".");
}
}
}
| UTF-8 | Java | 980 | java | DespawnEntityCommand.java | Java | [] | null | [] | package net.frozenorb.qmodsuite.command;
import net.frozenorb.qlib.command.Command;
import net.frozenorb.qlib.util.EntityUtils;
import net.frozenorb.qmodsuite.listeners.GeneralListener;
import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public final class DespawnEntityCommand {
@Command(
names = {"despawnentity"},
permission = "basic.staff"
)
public static void despawnentity(Player sender) {
if (!GeneralListener.getDespawn().containsKey(sender.getUniqueId())) {
sender.sendMessage(ChatColor.RED + "No entity to despawn.");
} else {
Entity entity = (Entity)GeneralListener.getDespawn().get(sender.getUniqueId());
GeneralListener.getDespawn().remove(sender.getUniqueId());
entity.remove();
sender.sendMessage(ChatColor.GOLD + "Successfully despawned the " + ChatColor.WHITE + EntityUtils.getName(entity.getType()) + ChatColor.GOLD + ".");
}
}
}
| 980 | 0.713265 | 0.713265 | 25 | 38.200001 | 34.474339 | 157 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52 | false | false | 14 |
ef18d9557dc899d7ead200e519757eac15f8cc8e | 31,834,297,630,696 | a2d5f8092e64e7ad41bd8b581a52f4f24a260131 | /sources/divide/maze/maze/R.java | 8cc4cbf65718d728d9d9c2e592cd3140046c62bc | [] | no_license | daniel-dona/virus-correos-apk | https://github.com/daniel-dona/virus-correos-apk | 221d4ff83e390558000e873cc5fc265469699e10 | e10845916c5da840c4b2f0a251e8f44e3a42096b | refs/heads/main | 2023-02-08T21:26:53.289000 | 2020-12-30T14:53:50 | 2020-12-30T14:53:50 | 325,573,864 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package divide.maze.maze;
/* This class is generated by JADX */
public final class R {
public static final class anim {
public static final int abc_fade_in = 2130771968;
public static final int abc_fade_out = 2130771969;
public static final int abc_grow_fade_in_from_bottom = 2130771970;
public static final int abc_popup_enter = 2130771971;
public static final int abc_popup_exit = 2130771972;
public static final int abc_shrink_fade_out_from_bottom = 2130771973;
public static final int abc_slide_in_bottom = 2130771974;
public static final int abc_slide_in_top = 2130771975;
public static final int abc_slide_out_bottom = 2130771976;
public static final int abc_slide_out_top = 2130771977;
public static final int abc_tooltip_enter = 2130771978;
public static final int abc_tooltip_exit = 2130771979;
public static final int btn_checkbox_to_checked_box_inner_merged_animation = 2130771980;
public static final int btn_checkbox_to_checked_box_outer_merged_animation = 2130771981;
public static final int btn_checkbox_to_checked_icon_null_animation = 2130771982;
public static final int btn_checkbox_to_unchecked_box_inner_merged_animation = 2130771983;
public static final int btn_checkbox_to_unchecked_check_path_merged_animation = 2130771984;
public static final int btn_checkbox_to_unchecked_icon_null_animation = 2130771985;
public static final int btn_radio_to_off_mtrl_dot_group_animation = 2130771986;
public static final int btn_radio_to_off_mtrl_ring_outer_animation = 2130771987;
public static final int btn_radio_to_off_mtrl_ring_outer_path_animation = 2130771988;
public static final int btn_radio_to_on_mtrl_dot_group_animation = 2130771989;
public static final int btn_radio_to_on_mtrl_ring_outer_animation = 2130771990;
public static final int btn_radio_to_on_mtrl_ring_outer_path_animation = 2130771991;
public static final int design_bottom_sheet_slide_in = 2130771992;
public static final int design_bottom_sheet_slide_out = 2130771993;
public static final int design_snackbar_in = 2130771994;
public static final int design_snackbar_out = 2130771995;
public static final int mtrl_bottom_sheet_slide_in = 2130771996;
public static final int mtrl_bottom_sheet_slide_out = 2130771997;
public static final int mtrl_card_lowers_interpolator = 2130771998;
}
public static final class animator {
public static final int design_appbar_state_list_animator = 2130837504;
public static final int design_fab_hide_motion_spec = 2130837505;
public static final int design_fab_show_motion_spec = 2130837506;
public static final int mtrl_btn_state_list_anim = 2130837507;
public static final int mtrl_btn_unelevated_state_list_anim = 2130837508;
public static final int mtrl_card_state_list_anim = 2130837509;
public static final int mtrl_chip_state_list_anim = 2130837510;
public static final int mtrl_extended_fab_change_size_motion_spec = 2130837511;
public static final int mtrl_extended_fab_hide_motion_spec = 2130837512;
public static final int mtrl_extended_fab_show_motion_spec = 2130837513;
public static final int mtrl_extended_fab_state_list_animator = 2130837514;
public static final int mtrl_fab_hide_motion_spec = 2130837515;
public static final int mtrl_fab_show_motion_spec = 2130837516;
public static final int mtrl_fab_transformation_sheet_collapse_spec = 2130837517;
public static final int mtrl_fab_transformation_sheet_expand_spec = 2130837518;
}
public static final class attr {
public static final int actionBarDivider = 2130903040;
public static final int actionBarItemBackground = 2130903041;
public static final int actionBarPopupTheme = 2130903042;
public static final int actionBarSize = 2130903043;
public static final int actionBarSplitStyle = 2130903044;
public static final int actionBarStyle = 2130903045;
public static final int actionBarTabBarStyle = 2130903046;
public static final int actionBarTabStyle = 2130903047;
public static final int actionBarTabTextStyle = 2130903048;
public static final int actionBarTheme = 2130903049;
public static final int actionBarWidgetTheme = 2130903050;
public static final int actionButtonStyle = 2130903051;
public static final int actionDropDownStyle = 2130903052;
public static final int actionLayout = 2130903053;
public static final int actionMenuTextAppearance = 2130903054;
public static final int actionMenuTextColor = 2130903055;
public static final int actionModeBackground = 2130903056;
public static final int actionModeCloseButtonStyle = 2130903057;
public static final int actionModeCloseDrawable = 2130903058;
public static final int actionModeCopyDrawable = 2130903059;
public static final int actionModeCutDrawable = 2130903060;
public static final int actionModeFindDrawable = 2130903061;
public static final int actionModePasteDrawable = 2130903062;
public static final int actionModePopupWindowStyle = 2130903063;
public static final int actionModeSelectAllDrawable = 2130903064;
public static final int actionModeShareDrawable = 2130903065;
public static final int actionModeSplitBackground = 2130903066;
public static final int actionModeStyle = 2130903067;
public static final int actionModeWebSearchDrawable = 2130903068;
public static final int actionOverflowButtonStyle = 2130903069;
public static final int actionOverflowMenuStyle = 2130903070;
public static final int actionProviderClass = 2130903071;
public static final int actionTextColorAlpha = 2130903072;
public static final int actionViewClass = 2130903073;
public static final int activityChooserViewStyle = 2130903074;
public static final int alertDialogButtonGroupStyle = 2130903075;
public static final int alertDialogCenterButtons = 2130903076;
public static final int alertDialogStyle = 2130903077;
public static final int alertDialogTheme = 2130903078;
public static final int allowStacking = 2130903079;
public static final int alpha = 2130903080;
public static final int alphabeticModifiers = 2130903081;
public static final int animationMode = 2130903082;
public static final int appBarLayoutStyle = 2130903083;
public static final int arrowHeadLength = 2130903084;
public static final int arrowShaftLength = 2130903085;
public static final int autoCompleteTextViewStyle = 2130903086;
public static final int autoSizeMaxTextSize = 2130903087;
public static final int autoSizeMinTextSize = 2130903088;
public static final int autoSizePresetSizes = 2130903089;
public static final int autoSizeStepGranularity = 2130903090;
public static final int autoSizeTextType = 2130903091;
public static final int background = 2130903092;
public static final int backgroundColor = 2130903093;
public static final int backgroundInsetBottom = 2130903094;
public static final int backgroundInsetEnd = 2130903095;
public static final int backgroundInsetStart = 2130903096;
public static final int backgroundInsetTop = 2130903097;
public static final int backgroundOverlayColorAlpha = 2130903098;
public static final int backgroundSplit = 2130903099;
public static final int backgroundStacked = 2130903100;
public static final int backgroundTint = 2130903101;
public static final int backgroundTintMode = 2130903102;
public static final int badgeGravity = 2130903103;
public static final int badgeStyle = 2130903104;
public static final int badgeTextColor = 2130903105;
public static final int barLength = 2130903106;
public static final int barrierAllowsGoneWidgets = 2130903107;
public static final int barrierDirection = 2130903108;
public static final int behavior_autoHide = 2130903109;
public static final int behavior_autoShrink = 2130903110;
public static final int behavior_expandedOffset = 2130903111;
public static final int behavior_fitToContents = 2130903112;
public static final int behavior_halfExpandedRatio = 2130903113;
public static final int behavior_hideable = 2130903114;
public static final int behavior_overlapTop = 2130903115;
public static final int behavior_peekHeight = 2130903116;
public static final int behavior_saveFlags = 2130903117;
public static final int behavior_skipCollapsed = 2130903118;
public static final int borderWidth = 2130903119;
public static final int borderlessButtonStyle = 2130903120;
public static final int bottomAppBarStyle = 2130903121;
public static final int bottomNavigationStyle = 2130903122;
public static final int bottomSheetDialogTheme = 2130903123;
public static final int bottomSheetStyle = 2130903124;
public static final int boxBackgroundColor = 2130903125;
public static final int boxBackgroundMode = 2130903126;
public static final int boxCollapsedPaddingTop = 2130903127;
public static final int boxCornerRadiusBottomEnd = 2130903128;
public static final int boxCornerRadiusBottomStart = 2130903129;
public static final int boxCornerRadiusTopEnd = 2130903130;
public static final int boxCornerRadiusTopStart = 2130903131;
public static final int boxStrokeColor = 2130903132;
public static final int boxStrokeWidth = 2130903133;
public static final int boxStrokeWidthFocused = 2130903134;
public static final int buttonBarButtonStyle = 2130903135;
public static final int buttonBarNegativeButtonStyle = 2130903136;
public static final int buttonBarNeutralButtonStyle = 2130903137;
public static final int buttonBarPositiveButtonStyle = 2130903138;
public static final int buttonBarStyle = 2130903139;
public static final int buttonCompat = 2130903140;
public static final int buttonGravity = 2130903141;
public static final int buttonIconDimen = 2130903142;
public static final int buttonPanelSideLayout = 2130903143;
public static final int buttonStyle = 2130903144;
public static final int buttonStyleSmall = 2130903145;
public static final int buttonTint = 2130903146;
public static final int buttonTintMode = 2130903147;
public static final int cardBackgroundColor = 2130903148;
public static final int cardCornerRadius = 2130903149;
public static final int cardElevation = 2130903150;
public static final int cardForegroundColor = 2130903151;
public static final int cardMaxElevation = 2130903152;
public static final int cardPreventCornerOverlap = 2130903153;
public static final int cardUseCompatPadding = 2130903154;
public static final int cardViewStyle = 2130903155;
public static final int chainUseRtl = 2130903156;
public static final int checkboxStyle = 2130903157;
public static final int checkedButton = 2130903158;
public static final int checkedChip = 2130903159;
public static final int checkedIcon = 2130903160;
public static final int checkedIconEnabled = 2130903161;
public static final int checkedIconTint = 2130903162;
public static final int checkedIconVisible = 2130903163;
public static final int checkedTextViewStyle = 2130903164;
public static final int chipBackgroundColor = 2130903165;
public static final int chipCornerRadius = 2130903166;
public static final int chipEndPadding = 2130903167;
public static final int chipGroupStyle = 2130903168;
public static final int chipIcon = 2130903169;
public static final int chipIconEnabled = 2130903170;
public static final int chipIconSize = 2130903171;
public static final int chipIconTint = 2130903172;
public static final int chipIconVisible = 2130903173;
public static final int chipMinHeight = 2130903174;
public static final int chipMinTouchTargetSize = 2130903175;
public static final int chipSpacing = 2130903176;
public static final int chipSpacingHorizontal = 2130903177;
public static final int chipSpacingVertical = 2130903178;
public static final int chipStandaloneStyle = 2130903179;
public static final int chipStartPadding = 2130903180;
public static final int chipStrokeColor = 2130903181;
public static final int chipStrokeWidth = 2130903182;
public static final int chipStyle = 2130903183;
public static final int chipSurfaceColor = 2130903184;
public static final int closeIcon = 2130903185;
public static final int closeIconEnabled = 2130903186;
public static final int closeIconEndPadding = 2130903187;
public static final int closeIconSize = 2130903188;
public static final int closeIconStartPadding = 2130903189;
public static final int closeIconTint = 2130903190;
public static final int closeIconVisible = 2130903191;
public static final int closeItemLayout = 2130903192;
public static final int collapseContentDescription = 2130903193;
public static final int collapseIcon = 2130903194;
public static final int collapsedTitleGravity = 2130903195;
public static final int collapsedTitleTextAppearance = 2130903196;
public static final int color = 2130903197;
public static final int colorAccent = 2130903198;
public static final int colorBackgroundFloating = 2130903199;
public static final int colorButtonNormal = 2130903200;
public static final int colorControlActivated = 2130903201;
public static final int colorControlHighlight = 2130903202;
public static final int colorControlNormal = 2130903203;
public static final int colorError = 2130903204;
public static final int colorOnBackground = 2130903205;
public static final int colorOnError = 2130903206;
public static final int colorOnPrimary = 2130903207;
public static final int colorOnPrimarySurface = 2130903208;
public static final int colorOnSecondary = 2130903209;
public static final int colorOnSurface = 2130903210;
public static final int colorPrimary = 2130903211;
public static final int colorPrimaryDark = 2130903212;
public static final int colorPrimarySurface = 2130903213;
public static final int colorPrimaryVariant = 2130903214;
public static final int colorSecondary = 2130903215;
public static final int colorSecondaryVariant = 2130903216;
public static final int colorSurface = 2130903217;
public static final int colorSwitchThumbNormal = 2130903218;
public static final int commitIcon = 2130903219;
public static final int constraintSet = 2130903220;
public static final int constraint_referenced_ids = 2130903221;
public static final int content = 2130903222;
public static final int contentDescription = 2130903223;
public static final int contentInsetEnd = 2130903224;
public static final int contentInsetEndWithActions = 2130903225;
public static final int contentInsetLeft = 2130903226;
public static final int contentInsetRight = 2130903227;
public static final int contentInsetStart = 2130903228;
public static final int contentInsetStartWithNavigation = 2130903229;
public static final int contentPadding = 2130903230;
public static final int contentPaddingBottom = 2130903231;
public static final int contentPaddingLeft = 2130903232;
public static final int contentPaddingRight = 2130903233;
public static final int contentPaddingTop = 2130903234;
public static final int contentScrim = 2130903235;
public static final int controlBackground = 2130903236;
public static final int coordinatorLayoutStyle = 2130903237;
public static final int cornerFamily = 2130903238;
public static final int cornerFamilyBottomLeft = 2130903239;
public static final int cornerFamilyBottomRight = 2130903240;
public static final int cornerFamilyTopLeft = 2130903241;
public static final int cornerFamilyTopRight = 2130903242;
public static final int cornerRadius = 2130903243;
public static final int cornerSize = 2130903244;
public static final int cornerSizeBottomLeft = 2130903245;
public static final int cornerSizeBottomRight = 2130903246;
public static final int cornerSizeTopLeft = 2130903247;
public static final int cornerSizeTopRight = 2130903248;
public static final int counterEnabled = 2130903249;
public static final int counterMaxLength = 2130903250;
public static final int counterOverflowTextAppearance = 2130903251;
public static final int counterOverflowTextColor = 2130903252;
public static final int counterTextAppearance = 2130903253;
public static final int counterTextColor = 2130903254;
public static final int customNavigationLayout = 2130903255;
public static final int dayInvalidStyle = 2130903256;
public static final int daySelectedStyle = 2130903257;
public static final int dayStyle = 2130903258;
public static final int dayTodayStyle = 2130903259;
public static final int defaultQueryHint = 2130903260;
public static final int dialogCornerRadius = 2130903261;
public static final int dialogPreferredPadding = 2130903262;
public static final int dialogTheme = 2130903263;
public static final int displayOptions = 2130903264;
public static final int divider = 2130903265;
public static final int dividerHorizontal = 2130903266;
public static final int dividerPadding = 2130903267;
public static final int dividerVertical = 2130903268;
public static final int drawableBottomCompat = 2130903269;
public static final int drawableEndCompat = 2130903270;
public static final int drawableLeftCompat = 2130903271;
public static final int drawableRightCompat = 2130903272;
public static final int drawableSize = 2130903273;
public static final int drawableStartCompat = 2130903274;
public static final int drawableTint = 2130903275;
public static final int drawableTintMode = 2130903276;
public static final int drawableTopCompat = 2130903277;
public static final int drawerArrowStyle = 2130903278;
public static final int dropDownListViewStyle = 2130903279;
public static final int dropdownListPreferredItemHeight = 2130903280;
public static final int editTextBackground = 2130903281;
public static final int editTextColor = 2130903282;
public static final int editTextStyle = 2130903283;
public static final int elevation = 2130903284;
public static final int elevationOverlayColor = 2130903285;
public static final int elevationOverlayEnabled = 2130903286;
public static final int emptyVisibility = 2130903287;
public static final int endIconCheckable = 2130903288;
public static final int endIconContentDescription = 2130903289;
public static final int endIconDrawable = 2130903290;
public static final int endIconMode = 2130903291;
public static final int endIconTint = 2130903292;
public static final int endIconTintMode = 2130903293;
public static final int enforceMaterialTheme = 2130903294;
public static final int enforceTextAppearance = 2130903295;
public static final int ensureMinTouchTargetSize = 2130903296;
public static final int errorEnabled = 2130903297;
public static final int errorIconDrawable = 2130903298;
public static final int errorIconTint = 2130903299;
public static final int errorIconTintMode = 2130903300;
public static final int errorTextAppearance = 2130903301;
public static final int errorTextColor = 2130903302;
public static final int expandActivityOverflowButtonDrawable = 2130903303;
public static final int expanded = 2130903304;
public static final int expandedTitleGravity = 2130903305;
public static final int expandedTitleMargin = 2130903306;
public static final int expandedTitleMarginBottom = 2130903307;
public static final int expandedTitleMarginEnd = 2130903308;
public static final int expandedTitleMarginStart = 2130903309;
public static final int expandedTitleMarginTop = 2130903310;
public static final int expandedTitleTextAppearance = 2130903311;
public static final int extendMotionSpec = 2130903312;
public static final int extendedFloatingActionButtonStyle = 2130903313;
public static final int fabAlignmentMode = 2130903314;
public static final int fabAnimationMode = 2130903315;
public static final int fabCradleMargin = 2130903316;
public static final int fabCradleRoundedCornerRadius = 2130903317;
public static final int fabCradleVerticalOffset = 2130903318;
public static final int fabCustomSize = 2130903319;
public static final int fabSize = 2130903320;
public static final int fastScrollEnabled = 2130903321;
public static final int fastScrollHorizontalThumbDrawable = 2130903322;
public static final int fastScrollHorizontalTrackDrawable = 2130903323;
public static final int fastScrollVerticalThumbDrawable = 2130903324;
public static final int fastScrollVerticalTrackDrawable = 2130903325;
public static final int firstBaselineToTopHeight = 2130903326;
public static final int floatingActionButtonStyle = 2130903327;
public static final int font = 2130903328;
public static final int fontFamily = 2130903329;
public static final int fontProviderAuthority = 2130903330;
public static final int fontProviderCerts = 2130903331;
public static final int fontProviderFetchStrategy = 2130903332;
public static final int fontProviderFetchTimeout = 2130903333;
public static final int fontProviderPackage = 2130903334;
public static final int fontProviderQuery = 2130903335;
public static final int fontStyle = 2130903336;
public static final int fontVariationSettings = 2130903337;
public static final int fontWeight = 2130903338;
public static final int foregroundInsidePadding = 2130903339;
public static final int gapBetweenBars = 2130903340;
public static final int goIcon = 2130903341;
public static final int headerLayout = 2130903342;
public static final int height = 2130903343;
public static final int helperText = 2130903344;
public static final int helperTextEnabled = 2130903345;
public static final int helperTextTextAppearance = 2130903346;
public static final int helperTextTextColor = 2130903347;
public static final int hideMotionSpec = 2130903348;
public static final int hideOnContentScroll = 2130903349;
public static final int hideOnScroll = 2130903350;
public static final int hintAnimationEnabled = 2130903351;
public static final int hintEnabled = 2130903352;
public static final int hintTextAppearance = 2130903353;
public static final int hintTextColor = 2130903354;
public static final int homeAsUpIndicator = 2130903355;
public static final int homeLayout = 2130903356;
public static final int hoveredFocusedTranslationZ = 2130903357;
public static final int icon = 2130903358;
public static final int iconEndPadding = 2130903359;
public static final int iconGravity = 2130903360;
public static final int iconPadding = 2130903361;
public static final int iconSize = 2130903362;
public static final int iconStartPadding = 2130903363;
public static final int iconTint = 2130903364;
public static final int iconTintMode = 2130903365;
public static final int iconifiedByDefault = 2130903366;
public static final int imageButtonStyle = 2130903367;
public static final int indeterminateProgressStyle = 2130903368;
public static final int initialActivityCount = 2130903369;
public static final int insetForeground = 2130903370;
public static final int isLightTheme = 2130903371;
public static final int isMaterialTheme = 2130903372;
public static final int itemBackground = 2130903373;
public static final int itemFillColor = 2130903374;
public static final int itemHorizontalPadding = 2130903375;
public static final int itemHorizontalTranslationEnabled = 2130903376;
public static final int itemIconPadding = 2130903377;
public static final int itemIconSize = 2130903378;
public static final int itemIconTint = 2130903379;
public static final int itemMaxLines = 2130903380;
public static final int itemPadding = 2130903381;
public static final int itemRippleColor = 2130903382;
public static final int itemShapeAppearance = 2130903383;
public static final int itemShapeAppearanceOverlay = 2130903384;
public static final int itemShapeFillColor = 2130903385;
public static final int itemShapeInsetBottom = 2130903386;
public static final int itemShapeInsetEnd = 2130903387;
public static final int itemShapeInsetStart = 2130903388;
public static final int itemShapeInsetTop = 2130903389;
public static final int itemSpacing = 2130903390;
public static final int itemStrokeColor = 2130903391;
public static final int itemStrokeWidth = 2130903392;
public static final int itemTextAppearance = 2130903393;
public static final int itemTextAppearanceActive = 2130903394;
public static final int itemTextAppearanceInactive = 2130903395;
public static final int itemTextColor = 2130903396;
public static final int keylines = 2130903397;
public static final int labelVisibilityMode = 2130903398;
public static final int lastBaselineToBottomHeight = 2130903399;
public static final int layout = 2130903400;
public static final int layoutManager = 2130903401;
public static final int layout_anchor = 2130903402;
public static final int layout_anchorGravity = 2130903403;
public static final int layout_behavior = 2130903404;
public static final int layout_collapseMode = 2130903405;
public static final int layout_collapseParallaxMultiplier = 2130903406;
public static final int layout_constrainedHeight = 2130903407;
public static final int layout_constrainedWidth = 2130903408;
public static final int layout_constraintBaseline_creator = 2130903409;
public static final int layout_constraintBaseline_toBaselineOf = 2130903410;
public static final int layout_constraintBottom_creator = 2130903411;
public static final int layout_constraintBottom_toBottomOf = 2130903412;
public static final int layout_constraintBottom_toTopOf = 2130903413;
public static final int layout_constraintCircle = 2130903414;
public static final int layout_constraintCircleAngle = 2130903415;
public static final int layout_constraintCircleRadius = 2130903416;
public static final int layout_constraintDimensionRatio = 2130903417;
public static final int layout_constraintEnd_toEndOf = 2130903418;
public static final int layout_constraintEnd_toStartOf = 2130903419;
public static final int layout_constraintGuide_begin = 2130903420;
public static final int layout_constraintGuide_end = 2130903421;
public static final int layout_constraintGuide_percent = 2130903422;
public static final int layout_constraintHeight_default = 2130903423;
public static final int layout_constraintHeight_max = 2130903424;
public static final int layout_constraintHeight_min = 2130903425;
public static final int layout_constraintHeight_percent = 2130903426;
public static final int layout_constraintHorizontal_bias = 2130903427;
public static final int layout_constraintHorizontal_chainStyle = 2130903428;
public static final int layout_constraintHorizontal_weight = 2130903429;
public static final int layout_constraintLeft_creator = 2130903430;
public static final int layout_constraintLeft_toLeftOf = 2130903431;
public static final int layout_constraintLeft_toRightOf = 2130903432;
public static final int layout_constraintRight_creator = 2130903433;
public static final int layout_constraintRight_toLeftOf = 2130903434;
public static final int layout_constraintRight_toRightOf = 2130903435;
public static final int layout_constraintStart_toEndOf = 2130903436;
public static final int layout_constraintStart_toStartOf = 2130903437;
public static final int layout_constraintTop_creator = 2130903438;
public static final int layout_constraintTop_toBottomOf = 2130903439;
public static final int layout_constraintTop_toTopOf = 2130903440;
public static final int layout_constraintVertical_bias = 2130903441;
public static final int layout_constraintVertical_chainStyle = 2130903442;
public static final int layout_constraintVertical_weight = 2130903443;
public static final int layout_constraintWidth_default = 2130903444;
public static final int layout_constraintWidth_max = 2130903445;
public static final int layout_constraintWidth_min = 2130903446;
public static final int layout_constraintWidth_percent = 2130903447;
public static final int layout_dodgeInsetEdges = 2130903448;
public static final int layout_editor_absoluteX = 2130903449;
public static final int layout_editor_absoluteY = 2130903450;
public static final int layout_goneMarginBottom = 2130903451;
public static final int layout_goneMarginEnd = 2130903452;
public static final int layout_goneMarginLeft = 2130903453;
public static final int layout_goneMarginRight = 2130903454;
public static final int layout_goneMarginStart = 2130903455;
public static final int layout_goneMarginTop = 2130903456;
public static final int layout_insetEdge = 2130903457;
public static final int layout_keyline = 2130903458;
public static final int layout_optimizationLevel = 2130903459;
public static final int layout_scrollFlags = 2130903460;
public static final int layout_scrollInterpolator = 2130903461;
public static final int liftOnScroll = 2130903462;
public static final int liftOnScrollTargetViewId = 2130903463;
public static final int lineHeight = 2130903464;
public static final int lineSpacing = 2130903465;
public static final int listChoiceBackgroundIndicator = 2130903466;
public static final int listChoiceIndicatorMultipleAnimated = 2130903467;
public static final int listChoiceIndicatorSingleAnimated = 2130903468;
public static final int listDividerAlertDialog = 2130903469;
public static final int listItemLayout = 2130903470;
public static final int listLayout = 2130903471;
public static final int listMenuViewStyle = 2130903472;
public static final int listPopupWindowStyle = 2130903473;
public static final int listPreferredItemHeight = 2130903474;
public static final int listPreferredItemHeightLarge = 2130903475;
public static final int listPreferredItemHeightSmall = 2130903476;
public static final int listPreferredItemPaddingEnd = 2130903477;
public static final int listPreferredItemPaddingLeft = 2130903478;
public static final int listPreferredItemPaddingRight = 2130903479;
public static final int listPreferredItemPaddingStart = 2130903480;
public static final int logo = 2130903481;
public static final int logoDescription = 2130903482;
public static final int materialAlertDialogBodyTextStyle = 2130903483;
public static final int materialAlertDialogTheme = 2130903484;
public static final int materialAlertDialogTitleIconStyle = 2130903485;
public static final int materialAlertDialogTitlePanelStyle = 2130903486;
public static final int materialAlertDialogTitleTextStyle = 2130903487;
public static final int materialButtonOutlinedStyle = 2130903488;
public static final int materialButtonStyle = 2130903489;
public static final int materialButtonToggleGroupStyle = 2130903490;
public static final int materialCalendarDay = 2130903491;
public static final int materialCalendarFullscreenTheme = 2130903492;
public static final int materialCalendarHeaderConfirmButton = 2130903493;
public static final int materialCalendarHeaderDivider = 2130903494;
public static final int materialCalendarHeaderLayout = 2130903495;
public static final int materialCalendarHeaderSelection = 2130903496;
public static final int materialCalendarHeaderTitle = 2130903497;
public static final int materialCalendarHeaderToggleButton = 2130903498;
public static final int materialCalendarStyle = 2130903499;
public static final int materialCalendarTheme = 2130903500;
public static final int materialCardViewStyle = 2130903501;
public static final int materialThemeOverlay = 2130903502;
public static final int maxActionInlineWidth = 2130903503;
public static final int maxButtonHeight = 2130903504;
public static final int maxCharacterCount = 2130903505;
public static final int maxImageSize = 2130903506;
public static final int measureWithLargestChild = 2130903507;
public static final int menu = 2130903508;
public static final int minTouchTargetSize = 2130903509;
public static final int multiChoiceItemLayout = 2130903510;
public static final int navigationContentDescription = 2130903511;
public static final int navigationIcon = 2130903512;
public static final int navigationMode = 2130903513;
public static final int navigationViewStyle = 2130903514;
public static final int number = 2130903515;
public static final int numericModifiers = 2130903516;
public static final int overlapAnchor = 2130903517;
public static final int paddingBottomNoButtons = 2130903518;
public static final int paddingEnd = 2130903519;
public static final int paddingStart = 2130903520;
public static final int paddingTopNoTitle = 2130903521;
public static final int panelBackground = 2130903522;
public static final int panelMenuListTheme = 2130903523;
public static final int panelMenuListWidth = 2130903524;
public static final int passwordToggleContentDescription = 2130903525;
public static final int passwordToggleDrawable = 2130903526;
public static final int passwordToggleEnabled = 2130903527;
public static final int passwordToggleTint = 2130903528;
public static final int passwordToggleTintMode = 2130903529;
public static final int popupMenuBackground = 2130903530;
public static final int popupMenuStyle = 2130903531;
public static final int popupTheme = 2130903532;
public static final int popupWindowStyle = 2130903533;
public static final int preserveIconSpacing = 2130903534;
public static final int pressedTranslationZ = 2130903535;
public static final int progressBarPadding = 2130903536;
public static final int progressBarStyle = 2130903537;
public static final int queryBackground = 2130903538;
public static final int queryHint = 2130903539;
public static final int radioButtonStyle = 2130903540;
public static final int rangeFillColor = 2130903541;
public static final int ratingBarStyle = 2130903542;
public static final int ratingBarStyleIndicator = 2130903543;
public static final int ratingBarStyleSmall = 2130903544;
public static final int recyclerViewStyle = 2130903545;
public static final int reverseLayout = 2130903546;
public static final int rippleColor = 2130903547;
public static final int scrimAnimationDuration = 2130903548;
public static final int scrimBackground = 2130903549;
public static final int scrimVisibleHeightTrigger = 2130903550;
public static final int searchHintIcon = 2130903551;
public static final int searchIcon = 2130903552;
public static final int searchViewStyle = 2130903553;
public static final int seekBarStyle = 2130903554;
public static final int selectableItemBackground = 2130903555;
public static final int selectableItemBackgroundBorderless = 2130903556;
public static final int shapeAppearance = 2130903557;
public static final int shapeAppearanceLargeComponent = 2130903558;
public static final int shapeAppearanceMediumComponent = 2130903559;
public static final int shapeAppearanceOverlay = 2130903560;
public static final int shapeAppearanceSmallComponent = 2130903561;
public static final int showAsAction = 2130903562;
public static final int showDividers = 2130903563;
public static final int showMotionSpec = 2130903564;
public static final int showText = 2130903565;
public static final int showTitle = 2130903566;
public static final int shrinkMotionSpec = 2130903567;
public static final int singleChoiceItemLayout = 2130903568;
public static final int singleLine = 2130903569;
public static final int singleSelection = 2130903570;
public static final int snackbarButtonStyle = 2130903571;
public static final int snackbarStyle = 2130903572;
public static final int spanCount = 2130903573;
public static final int spinBars = 2130903574;
public static final int spinnerDropDownItemStyle = 2130903575;
public static final int spinnerStyle = 2130903576;
public static final int splitTrack = 2130903577;
public static final int srcCompat = 2130903578;
public static final int stackFromEnd = 2130903579;
public static final int startIconCheckable = 2130903580;
public static final int startIconContentDescription = 2130903581;
public static final int startIconDrawable = 2130903582;
public static final int startIconTint = 2130903583;
public static final int startIconTintMode = 2130903584;
public static final int state_above_anchor = 2130903585;
public static final int state_collapsed = 2130903586;
public static final int state_collapsible = 2130903587;
public static final int state_dragged = 2130903588;
public static final int state_liftable = 2130903589;
public static final int state_lifted = 2130903590;
public static final int statusBarBackground = 2130903591;
public static final int statusBarForeground = 2130903592;
public static final int statusBarScrim = 2130903593;
public static final int strokeColor = 2130903594;
public static final int strokeWidth = 2130903595;
public static final int subMenuArrow = 2130903596;
public static final int submitBackground = 2130903597;
public static final int subtitle = 2130903598;
public static final int subtitleTextAppearance = 2130903599;
public static final int subtitleTextColor = 2130903600;
public static final int subtitleTextStyle = 2130903601;
public static final int suggestionRowLayout = 2130903602;
public static final int switchMinWidth = 2130903603;
public static final int switchPadding = 2130903604;
public static final int switchStyle = 2130903605;
public static final int switchTextAppearance = 2130903606;
public static final int tabBackground = 2130903607;
public static final int tabContentStart = 2130903608;
public static final int tabGravity = 2130903609;
public static final int tabIconTint = 2130903610;
public static final int tabIconTintMode = 2130903611;
public static final int tabIndicator = 2130903612;
public static final int tabIndicatorAnimationDuration = 2130903613;
public static final int tabIndicatorColor = 2130903614;
public static final int tabIndicatorFullWidth = 2130903615;
public static final int tabIndicatorGravity = 2130903616;
public static final int tabIndicatorHeight = 2130903617;
public static final int tabInlineLabel = 2130903618;
public static final int tabMaxWidth = 2130903619;
public static final int tabMinWidth = 2130903620;
public static final int tabMode = 2130903621;
public static final int tabPadding = 2130903622;
public static final int tabPaddingBottom = 2130903623;
public static final int tabPaddingEnd = 2130903624;
public static final int tabPaddingStart = 2130903625;
public static final int tabPaddingTop = 2130903626;
public static final int tabRippleColor = 2130903627;
public static final int tabSelectedTextColor = 2130903628;
public static final int tabStyle = 2130903629;
public static final int tabTextAppearance = 2130903630;
public static final int tabTextColor = 2130903631;
public static final int tabUnboundedRipple = 2130903632;
public static final int textAllCaps = 2130903633;
public static final int textAppearanceBody1 = 2130903634;
public static final int textAppearanceBody2 = 2130903635;
public static final int textAppearanceButton = 2130903636;
public static final int textAppearanceCaption = 2130903637;
public static final int textAppearanceHeadline1 = 2130903638;
public static final int textAppearanceHeadline2 = 2130903639;
public static final int textAppearanceHeadline3 = 2130903640;
public static final int textAppearanceHeadline4 = 2130903641;
public static final int textAppearanceHeadline5 = 2130903642;
public static final int textAppearanceHeadline6 = 2130903643;
public static final int textAppearanceLargePopupMenu = 2130903644;
public static final int textAppearanceLineHeightEnabled = 2130903645;
public static final int textAppearanceListItem = 2130903646;
public static final int textAppearanceListItemSecondary = 2130903647;
public static final int textAppearanceListItemSmall = 2130903648;
public static final int textAppearanceOverline = 2130903649;
public static final int textAppearancePopupMenuHeader = 2130903650;
public static final int textAppearanceSearchResultSubtitle = 2130903651;
public static final int textAppearanceSearchResultTitle = 2130903652;
public static final int textAppearanceSmallPopupMenu = 2130903653;
public static final int textAppearanceSubtitle1 = 2130903654;
public static final int textAppearanceSubtitle2 = 2130903655;
public static final int textColorAlertDialogListItem = 2130903656;
public static final int textColorSearchUrl = 2130903657;
public static final int textEndPadding = 2130903658;
public static final int textInputStyle = 2130903659;
public static final int textLocale = 2130903660;
public static final int textStartPadding = 2130903661;
public static final int theme = 2130903662;
public static final int themeLineHeight = 2130903663;
public static final int thickness = 2130903664;
public static final int thumbTextPadding = 2130903665;
public static final int thumbTint = 2130903666;
public static final int thumbTintMode = 2130903667;
public static final int tickMark = 2130903668;
public static final int tickMarkTint = 2130903669;
public static final int tickMarkTintMode = 2130903670;
public static final int tint = 2130903671;
public static final int tintMode = 2130903672;
public static final int title = 2130903673;
public static final int titleEnabled = 2130903674;
public static final int titleMargin = 2130903675;
public static final int titleMarginBottom = 2130903676;
public static final int titleMarginEnd = 2130903677;
public static final int titleMarginStart = 2130903678;
public static final int titleMarginTop = 2130903679;
public static final int titleMargins = 2130903680;
public static final int titleTextAppearance = 2130903681;
public static final int titleTextColor = 2130903682;
public static final int titleTextStyle = 2130903683;
public static final int toolbarId = 2130903684;
public static final int toolbarNavigationButtonStyle = 2130903685;
public static final int toolbarStyle = 2130903686;
public static final int tooltipForegroundColor = 2130903687;
public static final int tooltipFrameBackground = 2130903688;
public static final int tooltipText = 2130903689;
public static final int track = 2130903690;
public static final int trackTint = 2130903691;
public static final int trackTintMode = 2130903692;
public static final int ttcIndex = 2130903693;
public static final int useCompatPadding = 2130903694;
public static final int useMaterialThemeColors = 2130903695;
public static final int viewInflaterClass = 2130903696;
public static final int voiceIcon = 2130903697;
public static final int windowActionBar = 2130903698;
public static final int windowActionBarOverlay = 2130903699;
public static final int windowActionModeOverlay = 2130903700;
public static final int windowFixedHeightMajor = 2130903701;
public static final int windowFixedHeightMinor = 2130903702;
public static final int windowFixedWidthMajor = 2130903703;
public static final int windowFixedWidthMinor = 2130903704;
public static final int windowMinWidthMajor = 2130903705;
public static final int windowMinWidthMinor = 2130903706;
public static final int windowNoTitle = 2130903707;
public static final int yearSelectedStyle = 2130903708;
public static final int yearStyle = 2130903709;
public static final int yearTodayStyle = 2130903710;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 2130968576;
public static final int abc_allow_stacked_button_bar = 2130968577;
public static final int abc_config_actionMenuItemAllCaps = 2130968578;
public static final int mtrl_btn_textappearance_all_caps = 2130968579;
}
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark = 2131034112;
public static final int abc_background_cache_hint_selector_material_light = 2131034113;
public static final int abc_btn_colored_borderless_text_material = 2131034114;
public static final int abc_btn_colored_text_material = 2131034115;
public static final int abc_color_highlight_material = 2131034116;
public static final int abc_hint_foreground_material_dark = 2131034117;
public static final int abc_hint_foreground_material_light = 2131034118;
public static final int abc_input_method_navigation_guard = 2131034119;
public static final int abc_primary_text_disable_only_material_dark = 2131034120;
public static final int abc_primary_text_disable_only_material_light = 2131034121;
public static final int abc_primary_text_material_dark = 2131034122;
public static final int abc_primary_text_material_light = 2131034123;
public static final int abc_search_url_text = 2131034124;
public static final int abc_search_url_text_normal = 2131034125;
public static final int abc_search_url_text_pressed = 2131034126;
public static final int abc_search_url_text_selected = 2131034127;
public static final int abc_secondary_text_material_dark = 2131034128;
public static final int abc_secondary_text_material_light = 2131034129;
public static final int abc_tint_btn_checkable = 2131034130;
public static final int abc_tint_default = 2131034131;
public static final int abc_tint_edittext = 2131034132;
public static final int abc_tint_seek_thumb = 2131034133;
public static final int abc_tint_spinner = 2131034134;
public static final int abc_tint_switch_track = 2131034135;
public static final int accent_material_dark = 2131034136;
public static final int accent_material_light = 2131034137;
public static final int background_floating_material_dark = 2131034138;
public static final int background_floating_material_light = 2131034139;
public static final int background_material_dark = 2131034140;
public static final int background_material_light = 2131034141;
public static final int black = 2131034142;
public static final int bright_foreground_disabled_material_dark = 2131034143;
public static final int bright_foreground_disabled_material_light = 2131034144;
public static final int bright_foreground_inverse_material_dark = 2131034145;
public static final int bright_foreground_inverse_material_light = 2131034146;
public static final int bright_foreground_material_dark = 2131034147;
public static final int bright_foreground_material_light = 2131034148;
public static final int button_material_dark = 2131034149;
public static final int button_material_light = 2131034150;
public static final int cardview_dark_background = 2131034151;
public static final int cardview_light_background = 2131034152;
public static final int cardview_shadow_end_color = 2131034153;
public static final int cardview_shadow_start_color = 2131034154;
public static final int checkbox_themeable_attribute_color = 2131034155;
public static final int design_bottom_navigation_shadow_color = 2131034156;
public static final int design_box_stroke_color = 2131034157;
public static final int design_dark_default_color_background = 2131034158;
public static final int design_dark_default_color_error = 2131034159;
public static final int design_dark_default_color_on_background = 2131034160;
public static final int design_dark_default_color_on_error = 2131034161;
public static final int design_dark_default_color_on_primary = 2131034162;
public static final int design_dark_default_color_on_secondary = 2131034163;
public static final int design_dark_default_color_on_surface = 2131034164;
public static final int design_dark_default_color_primary = 2131034165;
public static final int design_dark_default_color_primary_dark = 2131034166;
public static final int design_dark_default_color_primary_variant = 2131034167;
public static final int design_dark_default_color_secondary = 2131034168;
public static final int design_dark_default_color_secondary_variant = 2131034169;
public static final int design_dark_default_color_surface = 2131034170;
public static final int design_default_color_background = 2131034171;
public static final int design_default_color_error = 2131034172;
public static final int design_default_color_on_background = 2131034173;
public static final int design_default_color_on_error = 2131034174;
public static final int design_default_color_on_primary = 2131034175;
public static final int design_default_color_on_secondary = 2131034176;
public static final int design_default_color_on_surface = 2131034177;
public static final int design_default_color_primary = 2131034178;
public static final int design_default_color_primary_dark = 2131034179;
public static final int design_default_color_primary_variant = 2131034180;
public static final int design_default_color_secondary = 2131034181;
public static final int design_default_color_secondary_variant = 2131034182;
public static final int design_default_color_surface = 2131034183;
public static final int design_error = 2131034184;
public static final int design_fab_shadow_end_color = 2131034185;
public static final int design_fab_shadow_mid_color = 2131034186;
public static final int design_fab_shadow_start_color = 2131034187;
public static final int design_fab_stroke_end_inner_color = 2131034188;
public static final int design_fab_stroke_end_outer_color = 2131034189;
public static final int design_fab_stroke_top_inner_color = 2131034190;
public static final int design_fab_stroke_top_outer_color = 2131034191;
public static final int design_icon_tint = 2131034192;
public static final int design_snackbar_background_color = 2131034193;
public static final int dim_foreground_disabled_material_dark = 2131034194;
public static final int dim_foreground_disabled_material_light = 2131034195;
public static final int dim_foreground_material_dark = 2131034196;
public static final int dim_foreground_material_light = 2131034197;
public static final int error_color_material_dark = 2131034198;
public static final int error_color_material_light = 2131034199;
public static final int foreground_material_dark = 2131034200;
public static final int foreground_material_light = 2131034201;
public static final int highlighted_text_material_dark = 2131034202;
public static final int highlighted_text_material_light = 2131034203;
public static final int material_blue_grey_800 = 2131034204;
public static final int material_blue_grey_900 = 2131034205;
public static final int material_blue_grey_950 = 2131034206;
public static final int material_deep_teal_200 = 2131034207;
public static final int material_deep_teal_500 = 2131034208;
public static final int material_grey_100 = 2131034209;
public static final int material_grey_300 = 2131034210;
public static final int material_grey_50 = 2131034211;
public static final int material_grey_600 = 2131034212;
public static final int material_grey_800 = 2131034213;
public static final int material_grey_850 = 2131034214;
public static final int material_grey_900 = 2131034215;
public static final int material_on_background_disabled = 2131034216;
public static final int material_on_background_emphasis_high_type = 2131034217;
public static final int material_on_background_emphasis_medium = 2131034218;
public static final int material_on_primary_disabled = 2131034219;
public static final int material_on_primary_emphasis_high_type = 2131034220;
public static final int material_on_primary_emphasis_medium = 2131034221;
public static final int material_on_surface_disabled = 2131034222;
public static final int material_on_surface_emphasis_high_type = 2131034223;
public static final int material_on_surface_emphasis_medium = 2131034224;
public static final int mtrl_bottom_nav_colored_item_tint = 2131034225;
public static final int mtrl_bottom_nav_colored_ripple_color = 2131034226;
public static final int mtrl_bottom_nav_item_tint = 2131034227;
public static final int mtrl_bottom_nav_ripple_color = 2131034228;
public static final int mtrl_btn_bg_color_selector = 2131034229;
public static final int mtrl_btn_ripple_color = 2131034230;
public static final int mtrl_btn_stroke_color_selector = 2131034231;
public static final int mtrl_btn_text_btn_bg_color_selector = 2131034232;
public static final int mtrl_btn_text_btn_ripple_color = 2131034233;
public static final int mtrl_btn_text_color_disabled = 2131034234;
public static final int mtrl_btn_text_color_selector = 2131034235;
public static final int mtrl_btn_transparent_bg_color = 2131034236;
public static final int mtrl_calendar_item_stroke_color = 2131034237;
public static final int mtrl_calendar_selected_range = 2131034238;
public static final int mtrl_card_view_foreground = 2131034239;
public static final int mtrl_card_view_ripple = 2131034240;
public static final int mtrl_chip_background_color = 2131034241;
public static final int mtrl_chip_close_icon_tint = 2131034242;
public static final int mtrl_chip_ripple_color = 2131034243;
public static final int mtrl_chip_surface_color = 2131034244;
public static final int mtrl_chip_text_color = 2131034245;
public static final int mtrl_choice_chip_background_color = 2131034246;
public static final int mtrl_choice_chip_ripple_color = 2131034247;
public static final int mtrl_choice_chip_text_color = 2131034248;
public static final int mtrl_error = 2131034249;
public static final int mtrl_extended_fab_bg_color_selector = 2131034250;
public static final int mtrl_extended_fab_ripple_color = 2131034251;
public static final int mtrl_extended_fab_text_color_selector = 2131034252;
public static final int mtrl_fab_ripple_color = 2131034253;
public static final int mtrl_filled_background_color = 2131034254;
public static final int mtrl_filled_icon_tint = 2131034255;
public static final int mtrl_filled_stroke_color = 2131034256;
public static final int mtrl_indicator_text_color = 2131034257;
public static final int mtrl_navigation_item_background_color = 2131034258;
public static final int mtrl_navigation_item_icon_tint = 2131034259;
public static final int mtrl_navigation_item_text_color = 2131034260;
public static final int mtrl_on_primary_text_btn_text_color_selector = 2131034261;
public static final int mtrl_outlined_icon_tint = 2131034262;
public static final int mtrl_outlined_stroke_color = 2131034263;
public static final int mtrl_popupmenu_overlay_color = 2131034264;
public static final int mtrl_scrim_color = 2131034265;
public static final int mtrl_tabs_colored_ripple_color = 2131034266;
public static final int mtrl_tabs_icon_color_selector = 2131034267;
public static final int mtrl_tabs_icon_color_selector_colored = 2131034268;
public static final int mtrl_tabs_legacy_text_color_selector = 2131034269;
public static final int mtrl_tabs_ripple_color = 2131034270;
public static final int mtrl_text_btn_text_color_selector = 2131034271;
public static final int mtrl_textinput_default_box_stroke_color = 2131034272;
public static final int mtrl_textinput_disabled_color = 2131034273;
public static final int mtrl_textinput_filled_box_default_background_color = 2131034274;
public static final int mtrl_textinput_focused_box_stroke_color = 2131034275;
public static final int mtrl_textinput_hovered_box_stroke_color = 2131034276;
public static final int notification_action_color_filter = 2131034277;
public static final int notification_icon_bg_color = 2131034278;
public static final int primary_dark_material_dark = 2131034279;
public static final int primary_dark_material_light = 2131034280;
public static final int primary_material_dark = 2131034281;
public static final int primary_material_light = 2131034282;
public static final int primary_text_default_material_dark = 2131034283;
public static final int primary_text_default_material_light = 2131034284;
public static final int primary_text_disabled_material_dark = 2131034285;
public static final int primary_text_disabled_material_light = 2131034286;
public static final int purple_200 = 2131034287;
public static final int purple_500 = 2131034288;
public static final int purple_700 = 2131034289;
public static final int ripple_material_dark = 2131034290;
public static final int ripple_material_light = 2131034291;
public static final int secondary_text_default_material_dark = 2131034292;
public static final int secondary_text_default_material_light = 2131034293;
public static final int secondary_text_disabled_material_dark = 2131034294;
public static final int secondary_text_disabled_material_light = 2131034295;
public static final int switch_thumb_disabled_material_dark = 2131034296;
public static final int switch_thumb_disabled_material_light = 2131034297;
public static final int switch_thumb_material_dark = 2131034298;
public static final int switch_thumb_material_light = 2131034299;
public static final int switch_thumb_normal_material_dark = 2131034300;
public static final int switch_thumb_normal_material_light = 2131034301;
public static final int teal_200 = 2131034302;
public static final int teal_700 = 2131034303;
public static final int test_mtrl_calendar_day = 2131034304;
public static final int test_mtrl_calendar_day_selected = 2131034305;
public static final int tooltip_background_dark = 2131034306;
public static final int tooltip_background_light = 2131034307;
public static final int white = 2131034308;
}
public static final class dimen {
public static final int abc_action_bar_content_inset_material = 2131099648;
public static final int abc_action_bar_content_inset_with_nav = 2131099649;
public static final int abc_action_bar_default_height_material = 2131099650;
public static final int abc_action_bar_default_padding_end_material = 2131099651;
public static final int abc_action_bar_default_padding_start_material = 2131099652;
public static final int abc_action_bar_elevation_material = 2131099653;
public static final int abc_action_bar_icon_vertical_padding_material = 2131099654;
public static final int abc_action_bar_overflow_padding_end_material = 2131099655;
public static final int abc_action_bar_overflow_padding_start_material = 2131099656;
public static final int abc_action_bar_stacked_max_height = 2131099657;
public static final int abc_action_bar_stacked_tab_max_width = 2131099658;
public static final int abc_action_bar_subtitle_bottom_margin_material = 2131099659;
public static final int abc_action_bar_subtitle_top_margin_material = 2131099660;
public static final int abc_action_button_min_height_material = 2131099661;
public static final int abc_action_button_min_width_material = 2131099662;
public static final int abc_action_button_min_width_overflow_material = 2131099663;
public static final int abc_alert_dialog_button_bar_height = 2131099664;
public static final int abc_alert_dialog_button_dimen = 2131099665;
public static final int abc_button_inset_horizontal_material = 2131099666;
public static final int abc_button_inset_vertical_material = 2131099667;
public static final int abc_button_padding_horizontal_material = 2131099668;
public static final int abc_button_padding_vertical_material = 2131099669;
public static final int abc_cascading_menus_min_smallest_width = 2131099670;
public static final int abc_config_prefDialogWidth = 2131099671;
public static final int abc_control_corner_material = 2131099672;
public static final int abc_control_inset_material = 2131099673;
public static final int abc_control_padding_material = 2131099674;
public static final int abc_dialog_corner_radius_material = 2131099675;
public static final int abc_dialog_fixed_height_major = 2131099676;
public static final int abc_dialog_fixed_height_minor = 2131099677;
public static final int abc_dialog_fixed_width_major = 2131099678;
public static final int abc_dialog_fixed_width_minor = 2131099679;
public static final int abc_dialog_list_padding_bottom_no_buttons = 2131099680;
public static final int abc_dialog_list_padding_top_no_title = 2131099681;
public static final int abc_dialog_min_width_major = 2131099682;
public static final int abc_dialog_min_width_minor = 2131099683;
public static final int abc_dialog_padding_material = 2131099684;
public static final int abc_dialog_padding_top_material = 2131099685;
public static final int abc_dialog_title_divider_material = 2131099686;
public static final int abc_disabled_alpha_material_dark = 2131099687;
public static final int abc_disabled_alpha_material_light = 2131099688;
public static final int abc_dropdownitem_icon_width = 2131099689;
public static final int abc_dropdownitem_text_padding_left = 2131099690;
public static final int abc_dropdownitem_text_padding_right = 2131099691;
public static final int abc_edit_text_inset_bottom_material = 2131099692;
public static final int abc_edit_text_inset_horizontal_material = 2131099693;
public static final int abc_edit_text_inset_top_material = 2131099694;
public static final int abc_floating_window_z = 2131099695;
public static final int abc_list_item_height_large_material = 2131099696;
public static final int abc_list_item_height_material = 2131099697;
public static final int abc_list_item_height_small_material = 2131099698;
public static final int abc_list_item_padding_horizontal_material = 2131099699;
public static final int abc_panel_menu_list_width = 2131099700;
public static final int abc_progress_bar_height_material = 2131099701;
public static final int abc_search_view_preferred_height = 2131099702;
public static final int abc_search_view_preferred_width = 2131099703;
public static final int abc_seekbar_track_background_height_material = 2131099704;
public static final int abc_seekbar_track_progress_height_material = 2131099705;
public static final int abc_select_dialog_padding_start_material = 2131099706;
public static final int abc_switch_padding = 2131099707;
public static final int abc_text_size_body_1_material = 2131099708;
public static final int abc_text_size_body_2_material = 2131099709;
public static final int abc_text_size_button_material = 2131099710;
public static final int abc_text_size_caption_material = 2131099711;
public static final int abc_text_size_display_1_material = 2131099712;
public static final int abc_text_size_display_2_material = 2131099713;
public static final int abc_text_size_display_3_material = 2131099714;
public static final int abc_text_size_display_4_material = 2131099715;
public static final int abc_text_size_headline_material = 2131099716;
public static final int abc_text_size_large_material = 2131099717;
public static final int abc_text_size_medium_material = 2131099718;
public static final int abc_text_size_menu_header_material = 2131099719;
public static final int abc_text_size_menu_material = 2131099720;
public static final int abc_text_size_small_material = 2131099721;
public static final int abc_text_size_subhead_material = 2131099722;
public static final int abc_text_size_subtitle_material_toolbar = 2131099723;
public static final int abc_text_size_title_material = 2131099724;
public static final int abc_text_size_title_material_toolbar = 2131099725;
public static final int action_bar_size = 2131099726;
public static final int appcompat_dialog_background_inset = 2131099727;
public static final int cardview_compat_inset_shadow = 2131099728;
public static final int cardview_default_elevation = 2131099729;
public static final int cardview_default_radius = 2131099730;
public static final int compat_button_inset_horizontal_material = 2131099731;
public static final int compat_button_inset_vertical_material = 2131099732;
public static final int compat_button_padding_horizontal_material = 2131099733;
public static final int compat_button_padding_vertical_material = 2131099734;
public static final int compat_control_corner_material = 2131099735;
public static final int compat_notification_large_icon_max_height = 2131099736;
public static final int compat_notification_large_icon_max_width = 2131099737;
public static final int default_dimension = 2131099738;
public static final int design_appbar_elevation = 2131099739;
public static final int design_bottom_navigation_active_item_max_width = 2131099740;
public static final int design_bottom_navigation_active_item_min_width = 2131099741;
public static final int design_bottom_navigation_active_text_size = 2131099742;
public static final int design_bottom_navigation_elevation = 2131099743;
public static final int design_bottom_navigation_height = 2131099744;
public static final int design_bottom_navigation_icon_size = 2131099745;
public static final int design_bottom_navigation_item_max_width = 2131099746;
public static final int design_bottom_navigation_item_min_width = 2131099747;
public static final int design_bottom_navigation_margin = 2131099748;
public static final int design_bottom_navigation_shadow_height = 2131099749;
public static final int design_bottom_navigation_text_size = 2131099750;
public static final int design_bottom_sheet_elevation = 2131099751;
public static final int design_bottom_sheet_modal_elevation = 2131099752;
public static final int design_bottom_sheet_peek_height_min = 2131099753;
public static final int design_fab_border_width = 2131099754;
public static final int design_fab_elevation = 2131099755;
public static final int design_fab_image_size = 2131099756;
public static final int design_fab_size_mini = 2131099757;
public static final int design_fab_size_normal = 2131099758;
public static final int design_fab_translation_z_hovered_focused = 2131099759;
public static final int design_fab_translation_z_pressed = 2131099760;
public static final int design_navigation_elevation = 2131099761;
public static final int design_navigation_icon_padding = 2131099762;
public static final int design_navigation_icon_size = 2131099763;
public static final int design_navigation_item_horizontal_padding = 2131099764;
public static final int design_navigation_item_icon_padding = 2131099765;
public static final int design_navigation_max_width = 2131099766;
public static final int design_navigation_padding_bottom = 2131099767;
public static final int design_navigation_separator_vertical_padding = 2131099768;
public static final int design_snackbar_action_inline_max_width = 2131099769;
public static final int design_snackbar_action_text_color_alpha = 2131099770;
public static final int design_snackbar_background_corner_radius = 2131099771;
public static final int design_snackbar_elevation = 2131099772;
public static final int design_snackbar_extra_spacing_horizontal = 2131099773;
public static final int design_snackbar_max_width = 2131099774;
public static final int design_snackbar_min_width = 2131099775;
public static final int design_snackbar_padding_horizontal = 2131099776;
public static final int design_snackbar_padding_vertical = 2131099777;
public static final int design_snackbar_padding_vertical_2lines = 2131099778;
public static final int design_snackbar_text_size = 2131099779;
public static final int design_tab_max_width = 2131099780;
public static final int design_tab_scrollable_min_width = 2131099781;
public static final int design_tab_text_size = 2131099782;
public static final int design_tab_text_size_2line = 2131099783;
public static final int design_textinput_caption_translate_y = 2131099784;
public static final int disabled_alpha_material_dark = 2131099785;
public static final int disabled_alpha_material_light = 2131099786;
public static final int fastscroll_default_thickness = 2131099787;
public static final int fastscroll_margin = 2131099788;
public static final int fastscroll_minimum_range = 2131099789;
public static final int highlight_alpha_material_colored = 2131099790;
public static final int highlight_alpha_material_dark = 2131099791;
public static final int highlight_alpha_material_light = 2131099792;
public static final int hint_alpha_material_dark = 2131099793;
public static final int hint_alpha_material_light = 2131099794;
public static final int hint_pressed_alpha_material_dark = 2131099795;
public static final int hint_pressed_alpha_material_light = 2131099796;
public static final int item_touch_helper_max_drag_scroll_per_frame = 2131099797;
public static final int item_touch_helper_swipe_escape_max_velocity = 2131099798;
public static final int item_touch_helper_swipe_escape_velocity = 2131099799;
public static final int material_emphasis_disabled = 2131099800;
public static final int material_emphasis_high_type = 2131099801;
public static final int material_emphasis_medium = 2131099802;
public static final int material_text_view_test_line_height = 2131099803;
public static final int material_text_view_test_line_height_override = 2131099804;
public static final int mtrl_alert_dialog_background_inset_bottom = 2131099805;
public static final int mtrl_alert_dialog_background_inset_end = 2131099806;
public static final int mtrl_alert_dialog_background_inset_start = 2131099807;
public static final int mtrl_alert_dialog_background_inset_top = 2131099808;
public static final int mtrl_alert_dialog_picker_background_inset = 2131099809;
public static final int mtrl_badge_horizontal_edge_offset = 2131099810;
public static final int mtrl_badge_long_text_horizontal_padding = 2131099811;
public static final int mtrl_badge_radius = 2131099812;
public static final int mtrl_badge_text_horizontal_edge_offset = 2131099813;
public static final int mtrl_badge_text_size = 2131099814;
public static final int mtrl_badge_with_text_radius = 2131099815;
public static final int mtrl_bottomappbar_fabOffsetEndMode = 2131099816;
public static final int mtrl_bottomappbar_fab_bottom_margin = 2131099817;
public static final int mtrl_bottomappbar_fab_cradle_margin = 2131099818;
public static final int mtrl_bottomappbar_fab_cradle_rounded_corner_radius = 2131099819;
public static final int mtrl_bottomappbar_fab_cradle_vertical_offset = 2131099820;
public static final int mtrl_bottomappbar_height = 2131099821;
public static final int mtrl_btn_corner_radius = 2131099822;
public static final int mtrl_btn_dialog_btn_min_width = 2131099823;
public static final int mtrl_btn_disabled_elevation = 2131099824;
public static final int mtrl_btn_disabled_z = 2131099825;
public static final int mtrl_btn_elevation = 2131099826;
public static final int mtrl_btn_focused_z = 2131099827;
public static final int mtrl_btn_hovered_z = 2131099828;
public static final int mtrl_btn_icon_btn_padding_left = 2131099829;
public static final int mtrl_btn_icon_padding = 2131099830;
public static final int mtrl_btn_inset = 2131099831;
public static final int mtrl_btn_letter_spacing = 2131099832;
public static final int mtrl_btn_padding_bottom = 2131099833;
public static final int mtrl_btn_padding_left = 2131099834;
public static final int mtrl_btn_padding_right = 2131099835;
public static final int mtrl_btn_padding_top = 2131099836;
public static final int mtrl_btn_pressed_z = 2131099837;
public static final int mtrl_btn_stroke_size = 2131099838;
public static final int mtrl_btn_text_btn_icon_padding = 2131099839;
public static final int mtrl_btn_text_btn_padding_left = 2131099840;
public static final int mtrl_btn_text_btn_padding_right = 2131099841;
public static final int mtrl_btn_text_size = 2131099842;
public static final int mtrl_btn_z = 2131099843;
public static final int mtrl_calendar_action_height = 2131099844;
public static final int mtrl_calendar_action_padding = 2131099845;
public static final int mtrl_calendar_bottom_padding = 2131099846;
public static final int mtrl_calendar_content_padding = 2131099847;
public static final int mtrl_calendar_day_corner = 2131099848;
public static final int mtrl_calendar_day_height = 2131099849;
public static final int mtrl_calendar_day_horizontal_padding = 2131099850;
public static final int mtrl_calendar_day_today_stroke = 2131099851;
public static final int mtrl_calendar_day_vertical_padding = 2131099852;
public static final int mtrl_calendar_day_width = 2131099853;
public static final int mtrl_calendar_days_of_week_height = 2131099854;
public static final int mtrl_calendar_dialog_background_inset = 2131099855;
public static final int mtrl_calendar_header_content_padding = 2131099856;
public static final int mtrl_calendar_header_content_padding_fullscreen = 2131099857;
public static final int mtrl_calendar_header_divider_thickness = 2131099858;
public static final int mtrl_calendar_header_height = 2131099859;
public static final int mtrl_calendar_header_height_fullscreen = 2131099860;
public static final int mtrl_calendar_header_selection_line_height = 2131099861;
public static final int mtrl_calendar_header_text_padding = 2131099862;
public static final int mtrl_calendar_header_toggle_margin_bottom = 2131099863;
public static final int mtrl_calendar_header_toggle_margin_top = 2131099864;
public static final int mtrl_calendar_landscape_header_width = 2131099865;
public static final int mtrl_calendar_maximum_default_fullscreen_minor_axis = 2131099866;
public static final int mtrl_calendar_month_horizontal_padding = 2131099867;
public static final int mtrl_calendar_month_vertical_padding = 2131099868;
public static final int mtrl_calendar_navigation_bottom_padding = 2131099869;
public static final int mtrl_calendar_navigation_height = 2131099870;
public static final int mtrl_calendar_navigation_top_padding = 2131099871;
public static final int mtrl_calendar_pre_l_text_clip_padding = 2131099872;
public static final int mtrl_calendar_selection_baseline_to_top_fullscreen = 2131099873;
public static final int mtrl_calendar_selection_text_baseline_to_bottom = 2131099874;
public static final int mtrl_calendar_selection_text_baseline_to_bottom_fullscreen = 2131099875;
public static final int mtrl_calendar_selection_text_baseline_to_top = 2131099876;
public static final int mtrl_calendar_text_input_padding_top = 2131099877;
public static final int mtrl_calendar_title_baseline_to_top = 2131099878;
public static final int mtrl_calendar_title_baseline_to_top_fullscreen = 2131099879;
public static final int mtrl_calendar_year_corner = 2131099880;
public static final int mtrl_calendar_year_height = 2131099881;
public static final int mtrl_calendar_year_horizontal_padding = 2131099882;
public static final int mtrl_calendar_year_vertical_padding = 2131099883;
public static final int mtrl_calendar_year_width = 2131099884;
public static final int mtrl_card_checked_icon_margin = 2131099885;
public static final int mtrl_card_checked_icon_size = 2131099886;
public static final int mtrl_card_corner_radius = 2131099887;
public static final int mtrl_card_dragged_z = 2131099888;
public static final int mtrl_card_elevation = 2131099889;
public static final int mtrl_card_spacing = 2131099890;
public static final int mtrl_chip_pressed_translation_z = 2131099891;
public static final int mtrl_chip_text_size = 2131099892;
public static final int mtrl_exposed_dropdown_menu_popup_elevation = 2131099893;
public static final int mtrl_exposed_dropdown_menu_popup_vertical_offset = 2131099894;
public static final int mtrl_exposed_dropdown_menu_popup_vertical_padding = 2131099895;
public static final int mtrl_extended_fab_bottom_padding = 2131099896;
public static final int mtrl_extended_fab_corner_radius = 2131099897;
public static final int mtrl_extended_fab_disabled_elevation = 2131099898;
public static final int mtrl_extended_fab_disabled_translation_z = 2131099899;
public static final int mtrl_extended_fab_elevation = 2131099900;
public static final int mtrl_extended_fab_end_padding = 2131099901;
public static final int mtrl_extended_fab_end_padding_icon = 2131099902;
public static final int mtrl_extended_fab_icon_size = 2131099903;
public static final int mtrl_extended_fab_icon_text_spacing = 2131099904;
public static final int mtrl_extended_fab_min_height = 2131099905;
public static final int mtrl_extended_fab_min_width = 2131099906;
public static final int mtrl_extended_fab_start_padding = 2131099907;
public static final int mtrl_extended_fab_start_padding_icon = 2131099908;
public static final int mtrl_extended_fab_top_padding = 2131099909;
public static final int mtrl_extended_fab_translation_z_base = 2131099910;
public static final int mtrl_extended_fab_translation_z_hovered_focused = 2131099911;
public static final int mtrl_extended_fab_translation_z_pressed = 2131099912;
public static final int mtrl_fab_elevation = 2131099913;
public static final int mtrl_fab_min_touch_target = 2131099914;
public static final int mtrl_fab_translation_z_hovered_focused = 2131099915;
public static final int mtrl_fab_translation_z_pressed = 2131099916;
public static final int mtrl_high_ripple_default_alpha = 2131099917;
public static final int mtrl_high_ripple_focused_alpha = 2131099918;
public static final int mtrl_high_ripple_hovered_alpha = 2131099919;
public static final int mtrl_high_ripple_pressed_alpha = 2131099920;
public static final int mtrl_large_touch_target = 2131099921;
public static final int mtrl_low_ripple_default_alpha = 2131099922;
public static final int mtrl_low_ripple_focused_alpha = 2131099923;
public static final int mtrl_low_ripple_hovered_alpha = 2131099924;
public static final int mtrl_low_ripple_pressed_alpha = 2131099925;
public static final int mtrl_min_touch_target_size = 2131099926;
public static final int mtrl_navigation_elevation = 2131099927;
public static final int mtrl_navigation_item_horizontal_padding = 2131099928;
public static final int mtrl_navigation_item_icon_padding = 2131099929;
public static final int mtrl_navigation_item_icon_size = 2131099930;
public static final int mtrl_navigation_item_shape_horizontal_margin = 2131099931;
public static final int mtrl_navigation_item_shape_vertical_margin = 2131099932;
public static final int mtrl_shape_corner_size_large_component = 2131099933;
public static final int mtrl_shape_corner_size_medium_component = 2131099934;
public static final int mtrl_shape_corner_size_small_component = 2131099935;
public static final int mtrl_snackbar_action_text_color_alpha = 2131099936;
public static final int mtrl_snackbar_background_corner_radius = 2131099937;
public static final int mtrl_snackbar_background_overlay_color_alpha = 2131099938;
public static final int mtrl_snackbar_margin = 2131099939;
public static final int mtrl_switch_thumb_elevation = 2131099940;
public static final int mtrl_textinput_box_corner_radius_medium = 2131099941;
public static final int mtrl_textinput_box_corner_radius_small = 2131099942;
public static final int mtrl_textinput_box_label_cutout_padding = 2131099943;
public static final int mtrl_textinput_box_stroke_width_default = 2131099944;
public static final int mtrl_textinput_box_stroke_width_focused = 2131099945;
public static final int mtrl_textinput_end_icon_margin_start = 2131099946;
public static final int mtrl_textinput_outline_box_expanded_padding = 2131099947;
public static final int mtrl_textinput_start_icon_margin_end = 2131099948;
public static final int mtrl_toolbar_default_height = 2131099949;
public static final int notification_action_icon_size = 2131099950;
public static final int notification_action_text_size = 2131099951;
public static final int notification_big_circle_margin = 2131099952;
public static final int notification_content_margin_start = 2131099953;
public static final int notification_large_icon_height = 2131099954;
public static final int notification_large_icon_width = 2131099955;
public static final int notification_main_column_padding_top = 2131099956;
public static final int notification_media_narrow_margin = 2131099957;
public static final int notification_right_icon_size = 2131099958;
public static final int notification_right_side_padding_top = 2131099959;
public static final int notification_small_icon_background_padding = 2131099960;
public static final int notification_small_icon_size_as_large = 2131099961;
public static final int notification_subtext_size = 2131099962;
public static final int notification_top_pad = 2131099963;
public static final int notification_top_pad_large_text = 2131099964;
public static final int test_mtrl_calendar_day_cornerSize = 2131099965;
public static final int tooltip_corner_radius = 2131099966;
public static final int tooltip_horizontal_padding = 2131099967;
public static final int tooltip_margin = 2131099968;
public static final int tooltip_precise_anchor_extra_offset = 2131099969;
public static final int tooltip_precise_anchor_threshold = 2131099970;
public static final int tooltip_vertical_padding = 2131099971;
public static final int tooltip_y_offset_non_touch = 2131099972;
public static final int tooltip_y_offset_touch = 2131099973;
}
public static final class drawable {
public static final int $avd_hide_password__0 = 2131165184;
public static final int $avd_hide_password__1 = 2131165185;
public static final int $avd_hide_password__2 = 2131165186;
public static final int $avd_show_password__0 = 2131165187;
public static final int $avd_show_password__1 = 2131165188;
public static final int $avd_show_password__2 = 2131165189;
public static final int $ic_launcher_foreground__0 = 2131165190;
public static final int abc_ab_share_pack_mtrl_alpha = 2131165191;
public static final int abc_action_bar_item_background_material = 2131165192;
public static final int abc_btn_borderless_material = 2131165193;
public static final int abc_btn_check_material = 2131165194;
public static final int abc_btn_check_material_anim = 2131165195;
public static final int abc_btn_check_to_on_mtrl_000 = 2131165196;
public static final int abc_btn_check_to_on_mtrl_015 = 2131165197;
public static final int abc_btn_colored_material = 2131165198;
public static final int abc_btn_default_mtrl_shape = 2131165199;
public static final int abc_btn_radio_material = 2131165200;
public static final int abc_btn_radio_material_anim = 2131165201;
public static final int abc_btn_radio_to_on_mtrl_000 = 2131165202;
public static final int abc_btn_radio_to_on_mtrl_015 = 2131165203;
public static final int abc_btn_switch_to_on_mtrl_00001 = 2131165204;
public static final int abc_btn_switch_to_on_mtrl_00012 = 2131165205;
public static final int abc_cab_background_internal_bg = 2131165206;
public static final int abc_cab_background_top_material = 2131165207;
public static final int abc_cab_background_top_mtrl_alpha = 2131165208;
public static final int abc_control_background_material = 2131165209;
public static final int abc_dialog_material_background = 2131165210;
public static final int abc_edit_text_material = 2131165211;
public static final int abc_ic_ab_back_material = 2131165212;
public static final int abc_ic_arrow_drop_right_black_24dp = 2131165213;
public static final int abc_ic_clear_material = 2131165214;
public static final int abc_ic_commit_search_api_mtrl_alpha = 2131165215;
public static final int abc_ic_go_search_api_material = 2131165216;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 2131165217;
public static final int abc_ic_menu_cut_mtrl_alpha = 2131165218;
public static final int abc_ic_menu_overflow_material = 2131165219;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 2131165220;
public static final int abc_ic_menu_selectall_mtrl_alpha = 2131165221;
public static final int abc_ic_menu_share_mtrl_alpha = 2131165222;
public static final int abc_ic_search_api_material = 2131165223;
public static final int abc_ic_star_black_16dp = 2131165224;
public static final int abc_ic_star_black_36dp = 2131165225;
public static final int abc_ic_star_black_48dp = 2131165226;
public static final int abc_ic_star_half_black_16dp = 2131165227;
public static final int abc_ic_star_half_black_36dp = 2131165228;
public static final int abc_ic_star_half_black_48dp = 2131165229;
public static final int abc_ic_voice_search_api_material = 2131165230;
public static final int abc_item_background_holo_dark = 2131165231;
public static final int abc_item_background_holo_light = 2131165232;
public static final int abc_list_divider_material = 2131165233;
public static final int abc_list_divider_mtrl_alpha = 2131165234;
public static final int abc_list_focused_holo = 2131165235;
public static final int abc_list_longpressed_holo = 2131165236;
public static final int abc_list_pressed_holo_dark = 2131165237;
public static final int abc_list_pressed_holo_light = 2131165238;
public static final int abc_list_selector_background_transition_holo_dark = 2131165239;
public static final int abc_list_selector_background_transition_holo_light = 2131165240;
public static final int abc_list_selector_disabled_holo_dark = 2131165241;
public static final int abc_list_selector_disabled_holo_light = 2131165242;
public static final int abc_list_selector_holo_dark = 2131165243;
public static final int abc_list_selector_holo_light = 2131165244;
public static final int abc_menu_hardkey_panel_mtrl_mult = 2131165245;
public static final int abc_popup_background_mtrl_mult = 2131165246;
public static final int abc_ratingbar_indicator_material = 2131165247;
public static final int abc_ratingbar_material = 2131165248;
public static final int abc_ratingbar_small_material = 2131165249;
public static final int abc_scrubber_control_off_mtrl_alpha = 2131165250;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 2131165251;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 2131165252;
public static final int abc_scrubber_primary_mtrl_alpha = 2131165253;
public static final int abc_scrubber_track_mtrl_alpha = 2131165254;
public static final int abc_seekbar_thumb_material = 2131165255;
public static final int abc_seekbar_tick_mark_material = 2131165256;
public static final int abc_seekbar_track_material = 2131165257;
public static final int abc_spinner_mtrl_am_alpha = 2131165258;
public static final int abc_spinner_textfield_background_material = 2131165259;
public static final int abc_switch_thumb_material = 2131165260;
public static final int abc_switch_track_mtrl_alpha = 2131165261;
public static final int abc_tab_indicator_material = 2131165262;
public static final int abc_tab_indicator_mtrl_alpha = 2131165263;
public static final int abc_text_cursor_material = 2131165264;
public static final int abc_text_select_handle_left_mtrl_dark = 2131165265;
public static final int abc_text_select_handle_left_mtrl_light = 2131165266;
public static final int abc_text_select_handle_middle_mtrl_dark = 2131165267;
public static final int abc_text_select_handle_middle_mtrl_light = 2131165268;
public static final int abc_text_select_handle_right_mtrl_dark = 2131165269;
public static final int abc_text_select_handle_right_mtrl_light = 2131165270;
public static final int abc_textfield_activated_mtrl_alpha = 2131165271;
public static final int abc_textfield_default_mtrl_alpha = 2131165272;
public static final int abc_textfield_search_activated_mtrl_alpha = 2131165273;
public static final int abc_textfield_search_default_mtrl_alpha = 2131165274;
public static final int abc_textfield_search_material = 2131165275;
public static final int abc_vector_test = 2131165276;
public static final int avd_hide_password = 2131165277;
public static final int avd_show_password = 2131165278;
public static final int btn_checkbox_checked_mtrl = 2131165279;
public static final int btn_checkbox_checked_to_unchecked_mtrl_animation = 2131165280;
public static final int btn_checkbox_unchecked_mtrl = 2131165281;
public static final int btn_checkbox_unchecked_to_checked_mtrl_animation = 2131165282;
public static final int btn_radio_off_mtrl = 2131165283;
public static final int btn_radio_off_to_on_mtrl_animation = 2131165284;
public static final int btn_radio_on_mtrl = 2131165285;
public static final int btn_radio_on_to_off_mtrl_animation = 2131165286;
public static final int design_bottom_navigation_item_background = 2131165287;
public static final int design_fab_background = 2131165288;
public static final int design_ic_visibility = 2131165289;
public static final int design_ic_visibility_off = 2131165290;
public static final int design_password_eye = 2131165291;
public static final int design_snackbar_background = 2131165292;
public static final int gpi = 2131165293;
public static final int ic_calendar_black_24dp = 2131165294;
public static final int ic_clear_black_24dp = 2131165295;
public static final int ic_edit_black_24dp = 2131165296;
public static final int ic_keyboard_arrow_left_black_24dp = 2131165297;
public static final int ic_keyboard_arrow_right_black_24dp = 2131165298;
public static final int ic_launcher_background = 2131165299;
public static final int ic_launcher_foreground = 2131165300;
public static final int ic_menu_arrow_down_black_24dp = 2131165301;
public static final int ic_menu_arrow_up_black_24dp = 2131165302;
public static final int ic_mtrl_checked_circle = 2131165303;
public static final int ic_mtrl_chip_checked_black = 2131165304;
public static final int ic_mtrl_chip_checked_circle = 2131165305;
public static final int ic_mtrl_chip_close_circle = 2131165306;
public static final int icon = 2131165307;
public static final int icon2 = 2131165308;
public static final int mtrl_dialog_background = 2131165309;
public static final int mtrl_dropdown_arrow = 2131165310;
public static final int mtrl_ic_arrow_drop_down = 2131165311;
public static final int mtrl_ic_arrow_drop_up = 2131165312;
public static final int mtrl_ic_cancel = 2131165313;
public static final int mtrl_ic_error = 2131165314;
public static final int mtrl_popupmenu_background = 2131165315;
public static final int mtrl_popupmenu_background_dark = 2131165316;
public static final int mtrl_tabs_default_indicator = 2131165317;
public static final int navigation_empty_icon = 2131165318;
public static final int notification_action_background = 2131165319;
public static final int notification_bg = 2131165320;
public static final int notification_bg_low = 2131165321;
public static final int notification_bg_low_normal = 2131165322;
public static final int notification_bg_low_pressed = 2131165323;
public static final int notification_bg_normal = 2131165324;
public static final int notification_bg_normal_pressed = 2131165325;
public static final int notification_icon_background = 2131165326;
public static final int notification_template_icon_bg = 2131165327;
public static final int notification_template_icon_low_bg = 2131165328;
public static final int notification_tile_bg = 2131165329;
public static final int notify_panel_notification_icon_bg = 2131165330;
public static final int tbi = 2131165331;
public static final int tbo = 2131165332;
public static final int test_custom_background = 2131165333;
public static final int tooltip_frame_dark = 2131165334;
public static final int tooltip_frame_light = 2131165335;
}
public static final class id {
public static final int ALT = 2131230720;
public static final int BOTTOM_END = 2131230721;
public static final int BOTTOM_START = 2131230722;
public static final int CTRL = 2131230723;
public static final int FUNCTION = 2131230724;
public static final int META = 2131230725;
public static final int SHIFT = 2131230726;
public static final int SYM = 2131230727;
public static final int TOP_END = 2131230728;
public static final int TOP_START = 2131230729;
public static final int accessibility_action_clickable_span = 2131230730;
public static final int accessibility_custom_action_0 = 2131230731;
public static final int accessibility_custom_action_1 = 2131230732;
public static final int accessibility_custom_action_10 = 2131230733;
public static final int accessibility_custom_action_11 = 2131230734;
public static final int accessibility_custom_action_12 = 2131230735;
public static final int accessibility_custom_action_13 = 2131230736;
public static final int accessibility_custom_action_14 = 2131230737;
public static final int accessibility_custom_action_15 = 2131230738;
public static final int accessibility_custom_action_16 = 2131230739;
public static final int accessibility_custom_action_17 = 2131230740;
public static final int accessibility_custom_action_18 = 2131230741;
public static final int accessibility_custom_action_19 = 2131230742;
public static final int accessibility_custom_action_2 = 2131230743;
public static final int accessibility_custom_action_20 = 2131230744;
public static final int accessibility_custom_action_21 = 2131230745;
public static final int accessibility_custom_action_22 = 2131230746;
public static final int accessibility_custom_action_23 = 2131230747;
public static final int accessibility_custom_action_24 = 2131230748;
public static final int accessibility_custom_action_25 = 2131230749;
public static final int accessibility_custom_action_26 = 2131230750;
public static final int accessibility_custom_action_27 = 2131230751;
public static final int accessibility_custom_action_28 = 2131230752;
public static final int accessibility_custom_action_29 = 2131230753;
public static final int accessibility_custom_action_3 = 2131230754;
public static final int accessibility_custom_action_30 = 2131230755;
public static final int accessibility_custom_action_31 = 2131230756;
public static final int accessibility_custom_action_4 = 2131230757;
public static final int accessibility_custom_action_5 = 2131230758;
public static final int accessibility_custom_action_6 = 2131230759;
public static final int accessibility_custom_action_7 = 2131230760;
public static final int accessibility_custom_action_8 = 2131230761;
public static final int accessibility_custom_action_9 = 2131230762;
public static final int action_bar = 2131230763;
public static final int action_bar_activity_content = 2131230764;
public static final int action_bar_container = 2131230765;
public static final int action_bar_root = 2131230766;
public static final int action_bar_spinner = 2131230767;
public static final int action_bar_subtitle = 2131230768;
public static final int action_bar_title = 2131230769;
public static final int action_container = 2131230770;
public static final int action_context_bar = 2131230771;
public static final int action_divider = 2131230772;
public static final int action_image = 2131230773;
public static final int action_menu_divider = 2131230774;
public static final int action_menu_presenter = 2131230775;
public static final int action_mode_bar = 2131230776;
public static final int action_mode_bar_stub = 2131230777;
public static final int action_mode_close_button = 2131230778;
public static final int action_text = 2131230779;
public static final int actions = 2131230780;
public static final int activity_chooser_view_content = 2131230781;
public static final int add = 2131230782;
public static final int alertTitle = 2131230783;
public static final int all = 2131230784;
public static final int always = 2131230785;
public static final int async = 2131230786;
public static final int auto = 2131230787;
public static final int barrier = 2131230788;
public static final int beginning = 2131230789;
public static final int blocking = 2131230790;
public static final int bottom = 2131230791;
public static final int buttonPanel = 2131230792;
public static final int cancel_button = 2131230793;
public static final int center = 2131230794;
public static final int center_horizontal = 2131230795;
public static final int center_vertical = 2131230796;
public static final int chains = 2131230797;
public static final int checkbox = 2131230798;
public static final int checked = 2131230799;
public static final int chip = 2131230800;
public static final int chip_group = 2131230801;
public static final int chronometer = 2131230802;
public static final int clear_text = 2131230803;
public static final int clip_horizontal = 2131230804;
public static final int clip_vertical = 2131230805;
public static final int collapseActionView = 2131230806;
public static final int composeBtn = 2131230807;
public static final int confirm_button = 2131230808;
public static final int contactMsg = 2131230809;
public static final int contactName = 2131230810;
public static final int contactTime = 2131230811;
public static final int container = 2131230812;
public static final int content = 2131230813;
public static final int contentPanel = 2131230814;
public static final int convRl = 2131230815;
public static final int coordinator = 2131230816;
public static final int custom = 2131230817;
public static final int customPanel = 2131230818;
public static final int cut = 2131230819;
public static final int date_picker_actions = 2131230820;
public static final int decor_content_parent = 2131230821;
public static final int default_activity_button = 2131230822;
public static final int design_bottom_sheet = 2131230823;
public static final int design_menu_item_action_area = 2131230824;
public static final int design_menu_item_action_area_stub = 2131230825;
public static final int design_menu_item_text = 2131230826;
public static final int design_navigation_view = 2131230827;
public static final int dialog_button = 2131230828;
public static final int dimensions = 2131230829;
public static final int direct = 2131230830;
public static final int disableHome = 2131230831;
public static final int dropdown_menu = 2131230832;
public static final int editTextCardNumber = 2131230833;
public static final int editTextCvv = 2131230834;
public static final int editTextExpMonth = 2131230835;
public static final int editTextExpYear = 2131230836;
public static final int editTextName = 2131230837;
public static final int edit_query = 2131230838;
public static final int end = 2131230839;
public static final int enterAlways = 2131230840;
public static final int enterAlwaysCollapsed = 2131230841;
public static final int exitUntilCollapsed = 2131230842;
public static final int expand_activities_button = 2131230843;
public static final int expanded_menu = 2131230844;
public static final int fade = 2131230845;
public static final int fill = 2131230846;
public static final int fill_horizontal = 2131230847;
public static final int fill_vertical = 2131230848;
public static final int filled = 2131230849;
public static final int filter_chip = 2131230850;
public static final int fitToContents = 2131230851;
public static final int fixed = 2131230852;
public static final int forever = 2131230853;
public static final int ghost_view = 2131230854;
public static final int ghost_view_holder = 2131230855;
public static final int gone = 2131230856;
public static final int group_divider = 2131230857;
public static final int groups = 2131230858;
public static final int hideable = 2131230859;
public static final int home = 2131230860;
public static final int homeAsUp = 2131230861;
public static final int icon = 2131230862;
public static final int icon_group = 2131230863;
public static final int ifRoom = 2131230864;
public static final int image = 2131230865;
public static final int imageView = 2131230866;
public static final int info = 2131230867;
public static final int invisible = 2131230868;
public static final int italic = 2131230869;
public static final int item_touch_helper_previous_elevation = 2131230870;
public static final int labeled = 2131230871;
public static final int largeLabel = 2131230872;
public static final int layout = 2131230873;
public static final int left = 2131230874;
public static final int line1 = 2131230875;
public static final int line3 = 2131230876;
public static final int listMode = 2131230877;
public static final int listView = 2131230878;
public static final int list_item = 2131230879;
public static final int llExp = 2131230880;
public static final int masked = 2131230881;
public static final int message = 2131230882;
public static final int middle = 2131230883;
public static final int mini = 2131230884;
public static final int month_grid = 2131230885;
public static final int month_navigation_bar = 2131230886;
public static final int month_navigation_fragment_toggle = 2131230887;
public static final int month_navigation_next = 2131230888;
public static final int month_navigation_previous = 2131230889;
public static final int month_title = 2131230890;
public static final int mtrl_calendar_day_selector_frame = 2131230891;
public static final int mtrl_calendar_days_of_week = 2131230892;
public static final int mtrl_calendar_frame = 2131230893;
public static final int mtrl_calendar_main_pane = 2131230894;
public static final int mtrl_calendar_months = 2131230895;
public static final int mtrl_calendar_selection_frame = 2131230896;
public static final int mtrl_calendar_text_input_frame = 2131230897;
public static final int mtrl_calendar_year_selector_frame = 2131230898;
public static final int mtrl_card_checked_layer_id = 2131230899;
public static final int mtrl_child_content_container = 2131230900;
public static final int mtrl_internal_children_alpha_tag = 2131230901;
public static final int mtrl_picker_fullscreen = 2131230902;
public static final int mtrl_picker_header = 2131230903;
public static final int mtrl_picker_header_selection_text = 2131230904;
public static final int mtrl_picker_header_title_and_selection = 2131230905;
public static final int mtrl_picker_header_toggle = 2131230906;
public static final int mtrl_picker_text_input_date = 2131230907;
public static final int mtrl_picker_text_input_range_end = 2131230908;
public static final int mtrl_picker_text_input_range_start = 2131230909;
public static final int mtrl_picker_title_text = 2131230910;
public static final int multiply = 2131230911;
public static final int navigation_header_container = 2131230912;
public static final int never = 2131230913;
public static final int noScroll = 2131230914;
public static final int none = 2131230915;
public static final int normal = 2131230916;
public static final int notification_background = 2131230917;
public static final int notification_main_column = 2131230918;
public static final int notification_main_column_container = 2131230919;
public static final int off = 2131230920;
public static final int on = 2131230921;
public static final int outline = 2131230922;
public static final int packed = 2131230923;
public static final int parallax = 2131230924;
public static final int parent = 2131230925;
public static final int parentPanel = 2131230926;
public static final int parent_matrix = 2131230927;
public static final int password_toggle = 2131230928;
public static final int peekHeight = 2131230929;
public static final int percent = 2131230930;
public static final int pin = 2131230931;
public static final int progress_circular = 2131230932;
public static final int progress_horizontal = 2131230933;
public static final int radio = 2131230934;
public static final int right = 2131230935;
public static final int right_icon = 2131230936;
public static final int right_side = 2131230937;
public static final int rlControl = 2131230938;
public static final int rounded = 2131230939;
public static final int save_non_transition_alpha = 2131230940;
public static final int save_overlay_view = 2131230941;
public static final int scale = 2131230942;
public static final int screen = 2131230943;
public static final int scroll = 2131230944;
public static final int scrollIndicatorDown = 2131230945;
public static final int scrollIndicatorUp = 2131230946;
public static final int scrollView = 2131230947;
public static final int scrollable = 2131230948;
public static final int search_badge = 2131230949;
public static final int search_bar = 2131230950;
public static final int search_button = 2131230951;
public static final int search_close_btn = 2131230952;
public static final int search_edit_frame = 2131230953;
public static final int search_go_btn = 2131230954;
public static final int search_mag_icon = 2131230955;
public static final int search_plate = 2131230956;
public static final int search_src_text = 2131230957;
public static final int search_voice_btn = 2131230958;
public static final int select_dialog_listview = 2131230959;
public static final int selected = 2131230960;
public static final int sendSmsBtn = 2131230961;
public static final int shortcut = 2131230962;
public static final int showCustom = 2131230963;
public static final int showHome = 2131230964;
public static final int showTitle = 2131230965;
public static final int skipCollapsed = 2131230966;
public static final int slide = 2131230967;
public static final int smallLabel = 2131230968;
public static final int smsEditText = 2131230969;
public static final int snackbar_action = 2131230970;
public static final int snackbar_text = 2131230971;
public static final int snap = 2131230972;
public static final int snapMargins = 2131230973;
public static final int spacer = 2131230974;
public static final int split_action_bar = 2131230975;
public static final int spread = 2131230976;
public static final int spread_inside = 2131230977;
public static final int src_atop = 2131230978;
public static final int src_in = 2131230979;
public static final int src_over = 2131230980;
public static final int standard = 2131230981;
public static final int start = 2131230982;
public static final int stretch = 2131230983;
public static final int submenuarrow = 2131230984;
public static final int submitBtn = 2131230985;
public static final int submit_area = 2131230986;
public static final int tabLayout = 2131230987;
public static final int tabMode = 2131230988;
public static final int tag_accessibility_actions = 2131230989;
public static final int tag_accessibility_clickable_spans = 2131230990;
public static final int tag_accessibility_heading = 2131230991;
public static final int tag_accessibility_pane_title = 2131230992;
public static final int tag_screen_reader_focusable = 2131230993;
public static final int tag_transition_group = 2131230994;
public static final int tag_unhandled_key_event_manager = 2131230995;
public static final int tag_unhandled_key_listeners = 2131230996;
public static final int test_checkbox_android_button_tint = 2131230997;
public static final int test_checkbox_app_button_tint = 2131230998;
public static final int text = 2131230999;
public static final int text2 = 2131231000;
public static final int textEnd = 2131231001;
public static final int textSpacerNoButtons = 2131231002;
public static final int textSpacerNoTitle = 2131231003;
public static final int textStart = 2131231004;
public static final int textViewDesc = 2131231005;
public static final int textViewExp = 2131231006;
public static final int textViewTitle = 2131231007;
public static final int text_appname = 2131231008;
public static final int text_input_end_icon = 2131231009;
public static final int text_input_start_icon = 2131231010;
public static final int text_message = 2131231011;
public static final int text_title = 2131231012;
public static final int textinput_counter = 2131231013;
public static final int textinput_error = 2131231014;
public static final int textinput_helper_text = 2131231015;
public static final int time = 2131231016;
public static final int title = 2131231017;
public static final int titleDividerNoCustom = 2131231018;
public static final int title_template = 2131231019;
public static final int top = 2131231020;
public static final int topPanel = 2131231021;
public static final int touch_outside = 2131231022;
public static final int transition_current_scene = 2131231023;
public static final int transition_layout_save = 2131231024;
public static final int transition_position = 2131231025;
public static final int transition_scene_layoutid_cache = 2131231026;
public static final int transition_transform = 2131231027;
public static final int unchecked = 2131231028;
public static final int uniform = 2131231029;
public static final int unlabeled = 2131231030;
public static final int up = 2131231031;
public static final int useLogo = 2131231032;
public static final int view_offset_helper = 2131231033;
public static final int visible = 2131231034;
public static final int webView = 2131231035;
public static final int withText = 2131231036;
public static final int wrap = 2131231037;
public static final int wrap_content = 2131231038;
}
public static final class integer {
public static final int abc_config_activityDefaultDur = 2131296256;
public static final int abc_config_activityShortDur = 2131296257;
public static final int app_bar_elevation_anim_duration = 2131296258;
public static final int bottom_sheet_slide_duration = 2131296259;
public static final int cancel_button_image_alpha = 2131296260;
public static final int config_tooltipAnimTime = 2131296261;
public static final int design_snackbar_text_max_lines = 2131296262;
public static final int design_tab_indicator_anim_duration_ms = 2131296263;
public static final int hide_password_duration = 2131296264;
public static final int mtrl_badge_max_character_count = 2131296265;
public static final int mtrl_btn_anim_delay_ms = 2131296266;
public static final int mtrl_btn_anim_duration_ms = 2131296267;
public static final int mtrl_calendar_header_orientation = 2131296268;
public static final int mtrl_calendar_selection_text_lines = 2131296269;
public static final int mtrl_calendar_year_selector_span = 2131296270;
public static final int mtrl_card_anim_delay_ms = 2131296271;
public static final int mtrl_card_anim_duration_ms = 2131296272;
public static final int mtrl_chip_anim_duration = 2131296273;
public static final int mtrl_tab_indicator_anim_duration_ms = 2131296274;
public static final int show_password_duration = 2131296275;
public static final int status_bar_notification_info_maxnum = 2131296276;
}
public static final class interpolator {
public static final int btn_checkbox_checked_mtrl_animation_interpolator_0 = 2131361792;
public static final int btn_checkbox_checked_mtrl_animation_interpolator_1 = 2131361793;
public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_0 = 2131361794;
public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_1 = 2131361795;
public static final int btn_radio_to_off_mtrl_animation_interpolator_0 = 2131361796;
public static final int btn_radio_to_on_mtrl_animation_interpolator_0 = 2131361797;
public static final int fast_out_slow_in = 2131361798;
public static final int mtrl_fast_out_linear_in = 2131361799;
public static final int mtrl_fast_out_slow_in = 2131361800;
public static final int mtrl_linear = 2131361801;
public static final int mtrl_linear_out_slow_in = 2131361802;
}
public static final class layout {
public static final int abc_action_bar_title_item = 2131427328;
public static final int abc_action_bar_up_container = 2131427329;
public static final int abc_action_menu_item_layout = 2131427330;
public static final int abc_action_menu_layout = 2131427331;
public static final int abc_action_mode_bar = 2131427332;
public static final int abc_action_mode_close_item_material = 2131427333;
public static final int abc_activity_chooser_view = 2131427334;
public static final int abc_activity_chooser_view_list_item = 2131427335;
public static final int abc_alert_dialog_button_bar_material = 2131427336;
public static final int abc_alert_dialog_material = 2131427337;
public static final int abc_alert_dialog_title_material = 2131427338;
public static final int abc_cascading_menu_item_layout = 2131427339;
public static final int abc_dialog_title_material = 2131427340;
public static final int abc_expanded_menu_layout = 2131427341;
public static final int abc_list_menu_item_checkbox = 2131427342;
public static final int abc_list_menu_item_icon = 2131427343;
public static final int abc_list_menu_item_layout = 2131427344;
public static final int abc_list_menu_item_radio = 2131427345;
public static final int abc_popup_menu_header_item_layout = 2131427346;
public static final int abc_popup_menu_item_layout = 2131427347;
public static final int abc_screen_content_include = 2131427348;
public static final int abc_screen_simple = 2131427349;
public static final int abc_screen_simple_overlay_action_mode = 2131427350;
public static final int abc_screen_toolbar = 2131427351;
public static final int abc_search_dropdown_item_icons_2line = 2131427352;
public static final int abc_search_view = 2131427353;
public static final int abc_select_dialog_material = 2131427354;
public static final int abc_tooltip = 2131427355;
public static final int activity_browser = 2131427356;
public static final int activity_card = 2131427357;
public static final int activity_compose_sms = 2131427358;
public static final int activity_intent_starter = 2131427359;
public static final int activity_main = 2131427360;
public static final int activity_sms_thread = 2131427361;
public static final int conv_list_item = 2131427362;
public static final int custom_dialog = 2131427363;
public static final int design_bottom_navigation_item = 2131427364;
public static final int design_bottom_sheet_dialog = 2131427365;
public static final int design_layout_snackbar = 2131427366;
public static final int design_layout_snackbar_include = 2131427367;
public static final int design_layout_tab_icon = 2131427368;
public static final int design_layout_tab_text = 2131427369;
public static final int design_menu_item_action_area = 2131427370;
public static final int design_navigation_item = 2131427371;
public static final int design_navigation_item_header = 2131427372;
public static final int design_navigation_item_separator = 2131427373;
public static final int design_navigation_item_subheader = 2131427374;
public static final int design_navigation_menu = 2131427375;
public static final int design_navigation_menu_item = 2131427376;
public static final int design_text_input_end_icon = 2131427377;
public static final int design_text_input_start_icon = 2131427378;
public static final int mtrl_alert_dialog = 2131427379;
public static final int mtrl_alert_dialog_actions = 2131427380;
public static final int mtrl_alert_dialog_title = 2131427381;
public static final int mtrl_alert_select_dialog_item = 2131427382;
public static final int mtrl_alert_select_dialog_multichoice = 2131427383;
public static final int mtrl_alert_select_dialog_singlechoice = 2131427384;
public static final int mtrl_calendar_day = 2131427385;
public static final int mtrl_calendar_day_of_week = 2131427386;
public static final int mtrl_calendar_days_of_week = 2131427387;
public static final int mtrl_calendar_horizontal = 2131427388;
public static final int mtrl_calendar_month = 2131427389;
public static final int mtrl_calendar_month_labeled = 2131427390;
public static final int mtrl_calendar_month_navigation = 2131427391;
public static final int mtrl_calendar_months = 2131427392;
public static final int mtrl_calendar_vertical = 2131427393;
public static final int mtrl_calendar_year = 2131427394;
public static final int mtrl_layout_snackbar = 2131427395;
public static final int mtrl_layout_snackbar_include = 2131427396;
public static final int mtrl_picker_actions = 2131427397;
public static final int mtrl_picker_dialog = 2131427398;
public static final int mtrl_picker_fullscreen = 2131427399;
public static final int mtrl_picker_header_dialog = 2131427400;
public static final int mtrl_picker_header_fullscreen = 2131427401;
public static final int mtrl_picker_header_selection_text = 2131427402;
public static final int mtrl_picker_header_title_text = 2131427403;
public static final int mtrl_picker_header_toggle = 2131427404;
public static final int mtrl_picker_text_input_date = 2131427405;
public static final int mtrl_picker_text_input_date_range = 2131427406;
public static final int notif_custom_empty = 2131427407;
public static final int notif_custom_view = 2131427408;
public static final int notification_action = 2131427409;
public static final int notification_action_tombstone = 2131427410;
public static final int notification_template_custom_big = 2131427411;
public static final int notification_template_icon_group = 2131427412;
public static final int notification_template_part_chronometer = 2131427413;
public static final int notification_template_part_time = 2131427414;
public static final int select_dialog_item_material = 2131427415;
public static final int select_dialog_multichoice_material = 2131427416;
public static final int select_dialog_singlechoice_material = 2131427417;
public static final int support_simple_spinner_dropdown_item = 2131427418;
public static final int test_action_chip = 2131427419;
public static final int test_design_checkbox = 2131427420;
public static final int test_reflow_chipgroup = 2131427421;
public static final int test_toolbar = 2131427422;
public static final int test_toolbar_custom_background = 2131427423;
public static final int test_toolbar_elevation = 2131427424;
public static final int test_toolbar_surface = 2131427425;
public static final int text_view_with_line_height_from_appearance = 2131427426;
public static final int text_view_with_line_height_from_layout = 2131427427;
public static final int text_view_with_line_height_from_style = 2131427428;
public static final int text_view_with_theme_line_height = 2131427429;
public static final int text_view_without_line_height = 2131427430;
}
public static final class menu {
public static final int menu = 2131492864;
}
public static final class mipmap {
public static final int ic_launcher = 2131558400;
public static final int ic_launcher_round = 2131558401;
}
public static final class plurals {
public static final int mtrl_badge_content_description = 2131623936;
}
public static final class string {
public static final int abc_action_bar_home_description = 2131689472;
public static final int abc_action_bar_up_description = 2131689473;
public static final int abc_action_menu_overflow_description = 2131689474;
public static final int abc_action_mode_done = 2131689475;
public static final int abc_activity_chooser_view_see_all = 2131689476;
public static final int abc_activitychooserview_choose_application = 2131689477;
public static final int abc_capital_off = 2131689478;
public static final int abc_capital_on = 2131689479;
public static final int abc_menu_alt_shortcut_label = 2131689480;
public static final int abc_menu_ctrl_shortcut_label = 2131689481;
public static final int abc_menu_delete_shortcut_label = 2131689482;
public static final int abc_menu_enter_shortcut_label = 2131689483;
public static final int abc_menu_function_shortcut_label = 2131689484;
public static final int abc_menu_meta_shortcut_label = 2131689485;
public static final int abc_menu_shift_shortcut_label = 2131689486;
public static final int abc_menu_space_shortcut_label = 2131689487;
public static final int abc_menu_sym_shortcut_label = 2131689488;
public static final int abc_prepend_shortcut_label = 2131689489;
public static final int abc_search_hint = 2131689490;
public static final int abc_searchview_description_clear = 2131689491;
public static final int abc_searchview_description_query = 2131689492;
public static final int abc_searchview_description_search = 2131689493;
public static final int abc_searchview_description_submit = 2131689494;
public static final int abc_searchview_description_voice = 2131689495;
public static final int abc_shareactionprovider_share_with = 2131689496;
public static final int abc_shareactionprovider_share_with_application = 2131689497;
public static final int abc_toolbar_collapse_description = 2131689498;
public static final int accessibility_service_description = 2131689499;
public static final int app_name = 2131689500;
public static final int appbar_scrolling_view_behavior = 2131689501;
public static final int bottom_sheet_behavior = 2131689502;
public static final int character_counter_content_description = 2131689503;
public static final int character_counter_overflowed_content_description = 2131689504;
public static final int character_counter_pattern = 2131689505;
public static final int chip_text = 2131689506;
public static final int clear_text_end_icon_content_description = 2131689507;
public static final int error_icon_content_description = 2131689508;
public static final int exposed_dropdown_menu_content_description = 2131689509;
public static final int fab_transformation_scrim_behavior = 2131689510;
public static final int fab_transformation_sheet_behavior = 2131689511;
public static final int hide_bottom_view_on_scroll_behavior = 2131689512;
public static final int icon_content_description = 2131689513;
public static final int mtrl_badge_numberless_content_description = 2131689514;
public static final int mtrl_chip_close_icon_content_description = 2131689515;
public static final int mtrl_exceed_max_badge_number_suffix = 2131689516;
public static final int mtrl_picker_a11y_next_month = 2131689517;
public static final int mtrl_picker_a11y_prev_month = 2131689518;
public static final int mtrl_picker_announce_current_selection = 2131689519;
public static final int mtrl_picker_cancel = 2131689520;
public static final int mtrl_picker_confirm = 2131689521;
public static final int mtrl_picker_date_header_selected = 2131689522;
public static final int mtrl_picker_date_header_title = 2131689523;
public static final int mtrl_picker_date_header_unselected = 2131689524;
public static final int mtrl_picker_day_of_week_column_header = 2131689525;
public static final int mtrl_picker_invalid_format = 2131689526;
public static final int mtrl_picker_invalid_format_example = 2131689527;
public static final int mtrl_picker_invalid_format_use = 2131689528;
public static final int mtrl_picker_invalid_range = 2131689529;
public static final int mtrl_picker_navigate_to_year_description = 2131689530;
public static final int mtrl_picker_out_of_range = 2131689531;
public static final int mtrl_picker_range_header_only_end_selected = 2131689532;
public static final int mtrl_picker_range_header_only_start_selected = 2131689533;
public static final int mtrl_picker_range_header_selected = 2131689534;
public static final int mtrl_picker_range_header_title = 2131689535;
public static final int mtrl_picker_range_header_unselected = 2131689536;
public static final int mtrl_picker_save = 2131689537;
public static final int mtrl_picker_text_input_date_hint = 2131689538;
public static final int mtrl_picker_text_input_date_range_end_hint = 2131689539;
public static final int mtrl_picker_text_input_date_range_start_hint = 2131689540;
public static final int mtrl_picker_text_input_day_abbr = 2131689541;
public static final int mtrl_picker_text_input_month_abbr = 2131689542;
public static final int mtrl_picker_text_input_year_abbr = 2131689543;
public static final int mtrl_picker_toggle_to_calendar_input_mode = 2131689544;
public static final int mtrl_picker_toggle_to_day_selection = 2131689545;
public static final int mtrl_picker_toggle_to_text_input_mode = 2131689546;
public static final int mtrl_picker_toggle_to_year_selection = 2131689547;
public static final int password_toggle_content_description = 2131689548;
public static final int path_password_eye = 2131689549;
public static final int path_password_eye_mask_strike_through = 2131689550;
public static final int path_password_eye_mask_visible = 2131689551;
public static final int path_password_strike_through = 2131689552;
public static final int search_menu_title = 2131689553;
public static final int status_bar_notification_info_overflow = 2131689554;
}
public static final class style {
public static final int AlertDialog_AppCompat = 2131755008;
public static final int AlertDialog_AppCompat_Light = 2131755009;
public static final int Animation_AppCompat_Dialog = 2131755010;
public static final int Animation_AppCompat_DropDownUp = 2131755011;
public static final int Animation_AppCompat_Tooltip = 2131755012;
public static final int Animation_Design_BottomSheetDialog = 2131755013;
public static final int Animation_MaterialComponents_BottomSheetDialog = 2131755014;
public static final int Base_AlertDialog_AppCompat = 2131755015;
public static final int Base_AlertDialog_AppCompat_Light = 2131755016;
public static final int Base_Animation_AppCompat_Dialog = 2131755017;
public static final int Base_Animation_AppCompat_DropDownUp = 2131755018;
public static final int Base_Animation_AppCompat_Tooltip = 2131755019;
public static final int Base_CardView = 2131755020;
public static final int Base_DialogWindowTitle_AppCompat = 2131755021;
public static final int Base_DialogWindowTitleBackground_AppCompat = 2131755022;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Icon = 2131755023;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Panel = 2131755024;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Text = 2131755025;
public static final int Base_TextAppearance_AppCompat = 2131755026;
public static final int Base_TextAppearance_AppCompat_Body1 = 2131755027;
public static final int Base_TextAppearance_AppCompat_Body2 = 2131755028;
public static final int Base_TextAppearance_AppCompat_Button = 2131755029;
public static final int Base_TextAppearance_AppCompat_Caption = 2131755030;
public static final int Base_TextAppearance_AppCompat_Display1 = 2131755031;
public static final int Base_TextAppearance_AppCompat_Display2 = 2131755032;
public static final int Base_TextAppearance_AppCompat_Display3 = 2131755033;
public static final int Base_TextAppearance_AppCompat_Display4 = 2131755034;
public static final int Base_TextAppearance_AppCompat_Headline = 2131755035;
public static final int Base_TextAppearance_AppCompat_Inverse = 2131755036;
public static final int Base_TextAppearance_AppCompat_Large = 2131755037;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 2131755038;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131755039;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131755040;
public static final int Base_TextAppearance_AppCompat_Medium = 2131755041;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 2131755042;
public static final int Base_TextAppearance_AppCompat_Menu = 2131755043;
public static final int Base_TextAppearance_AppCompat_SearchResult = 2131755044;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131755045;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 2131755046;
public static final int Base_TextAppearance_AppCompat_Small = 2131755047;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 2131755048;
public static final int Base_TextAppearance_AppCompat_Subhead = 2131755049;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131755050;
public static final int Base_TextAppearance_AppCompat_Title = 2131755051;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 2131755052;
public static final int Base_TextAppearance_AppCompat_Tooltip = 2131755053;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131755054;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131755055;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131755056;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131755057;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131755058;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131755059;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131755060;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 2131755061;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131755062;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 2131755063;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131755064;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131755065;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131755066;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131755067;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131755068;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 2131755069;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131755070;
public static final int Base_TextAppearance_MaterialComponents_Badge = 2131755071;
public static final int Base_TextAppearance_MaterialComponents_Button = 2131755072;
public static final int Base_TextAppearance_MaterialComponents_Headline6 = 2131755073;
public static final int Base_TextAppearance_MaterialComponents_Subtitle2 = 2131755074;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131755075;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131755076;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131755077;
public static final int Base_Theme_AppCompat = 2131755078;
public static final int Base_Theme_AppCompat_CompactMenu = 2131755079;
public static final int Base_Theme_AppCompat_Dialog = 2131755080;
public static final int Base_Theme_AppCompat_Dialog_Alert = 2131755081;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 2131755082;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 2131755083;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 2131755084;
public static final int Base_Theme_AppCompat_Light = 2131755085;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 2131755086;
public static final int Base_Theme_AppCompat_Light_Dialog = 2131755087;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 2131755088;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131755089;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131755090;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131755091;
public static final int Base_Theme_MaterialComponents = 2131755092;
public static final int Base_Theme_MaterialComponents_Bridge = 2131755093;
public static final int Base_Theme_MaterialComponents_CompactMenu = 2131755094;
public static final int Base_Theme_MaterialComponents_Dialog = 2131755095;
public static final int Base_Theme_MaterialComponents_Dialog_Alert = 2131755096;
public static final int Base_Theme_MaterialComponents_Dialog_Bridge = 2131755097;
public static final int Base_Theme_MaterialComponents_Dialog_FixedSize = 2131755098;
public static final int Base_Theme_MaterialComponents_Dialog_MinWidth = 2131755099;
public static final int Base_Theme_MaterialComponents_DialogWhenLarge = 2131755100;
public static final int Base_Theme_MaterialComponents_Light = 2131755101;
public static final int Base_Theme_MaterialComponents_Light_Bridge = 2131755102;
public static final int Base_Theme_MaterialComponents_Light_DarkActionBar = 2131755103;
public static final int Base_Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755104;
public static final int Base_Theme_MaterialComponents_Light_Dialog = 2131755105;
public static final int Base_Theme_MaterialComponents_Light_Dialog_Alert = 2131755106;
public static final int Base_Theme_MaterialComponents_Light_Dialog_Bridge = 2131755107;
public static final int Base_Theme_MaterialComponents_Light_Dialog_FixedSize = 2131755108;
public static final int Base_Theme_MaterialComponents_Light_Dialog_MinWidth = 2131755109;
public static final int Base_Theme_MaterialComponents_Light_DialogWhenLarge = 2131755110;
public static final int Base_ThemeOverlay_AppCompat = 2131755111;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 2131755112;
public static final int Base_ThemeOverlay_AppCompat_Dark = 2131755113;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131755114;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 2131755115;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 2131755116;
public static final int Base_ThemeOverlay_AppCompat_Light = 2131755117;
public static final int Base_ThemeOverlay_MaterialComponents_Dialog = 2131755118;
public static final int Base_ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755119;
public static final int Base_ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755120;
public static final int Base_V14_Theme_MaterialComponents = 2131755121;
public static final int Base_V14_Theme_MaterialComponents_Bridge = 2131755122;
public static final int Base_V14_Theme_MaterialComponents_Dialog = 2131755123;
public static final int Base_V14_Theme_MaterialComponents_Dialog_Bridge = 2131755124;
public static final int Base_V14_Theme_MaterialComponents_Light = 2131755125;
public static final int Base_V14_Theme_MaterialComponents_Light_Bridge = 2131755126;
public static final int Base_V14_Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755127;
public static final int Base_V14_Theme_MaterialComponents_Light_Dialog = 2131755128;
public static final int Base_V14_Theme_MaterialComponents_Light_Dialog_Bridge = 2131755129;
public static final int Base_V14_ThemeOverlay_MaterialComponents_Dialog = 2131755130;
public static final int Base_V14_ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755131;
public static final int Base_V14_ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755132;
public static final int Base_V21_Theme_AppCompat = 2131755133;
public static final int Base_V21_Theme_AppCompat_Dialog = 2131755134;
public static final int Base_V21_Theme_AppCompat_Light = 2131755135;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 2131755136;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 2131755137;
public static final int Base_V22_Theme_AppCompat = 2131755138;
public static final int Base_V22_Theme_AppCompat_Light = 2131755139;
public static final int Base_V23_Theme_AppCompat = 2131755140;
public static final int Base_V23_Theme_AppCompat_Light = 2131755141;
public static final int Base_V26_Theme_AppCompat = 2131755142;
public static final int Base_V26_Theme_AppCompat_Light = 2131755143;
public static final int Base_V26_Widget_AppCompat_Toolbar = 2131755144;
public static final int Base_V28_Theme_AppCompat = 2131755145;
public static final int Base_V28_Theme_AppCompat_Light = 2131755146;
public static final int Base_V7_Theme_AppCompat = 2131755147;
public static final int Base_V7_Theme_AppCompat_Dialog = 2131755148;
public static final int Base_V7_Theme_AppCompat_Light = 2131755149;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 2131755150;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 2131755151;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131755152;
public static final int Base_V7_Widget_AppCompat_EditText = 2131755153;
public static final int Base_V7_Widget_AppCompat_Toolbar = 2131755154;
public static final int Base_Widget_AppCompat_ActionBar = 2131755155;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 2131755156;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 2131755157;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 2131755158;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 2131755159;
public static final int Base_Widget_AppCompat_ActionButton = 2131755160;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 2131755161;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 2131755162;
public static final int Base_Widget_AppCompat_ActionMode = 2131755163;
public static final int Base_Widget_AppCompat_ActivityChooserView = 2131755164;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 2131755165;
public static final int Base_Widget_AppCompat_Button = 2131755166;
public static final int Base_Widget_AppCompat_Button_Borderless = 2131755167;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 2131755168;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131755169;
public static final int Base_Widget_AppCompat_Button_Colored = 2131755170;
public static final int Base_Widget_AppCompat_Button_Small = 2131755171;
public static final int Base_Widget_AppCompat_ButtonBar = 2131755172;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131755173;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131755174;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131755175;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 2131755176;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 2131755177;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131755178;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 2131755179;
public static final int Base_Widget_AppCompat_EditText = 2131755180;
public static final int Base_Widget_AppCompat_ImageButton = 2131755181;
public static final int Base_Widget_AppCompat_Light_ActionBar = 2131755182;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131755183;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131755184;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131755185;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131755186;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131755187;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 2131755188;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131755189;
public static final int Base_Widget_AppCompat_ListMenuView = 2131755190;
public static final int Base_Widget_AppCompat_ListPopupWindow = 2131755191;
public static final int Base_Widget_AppCompat_ListView = 2131755192;
public static final int Base_Widget_AppCompat_ListView_DropDown = 2131755193;
public static final int Base_Widget_AppCompat_ListView_Menu = 2131755194;
public static final int Base_Widget_AppCompat_PopupMenu = 2131755195;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 2131755196;
public static final int Base_Widget_AppCompat_PopupWindow = 2131755197;
public static final int Base_Widget_AppCompat_ProgressBar = 2131755198;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131755199;
public static final int Base_Widget_AppCompat_RatingBar = 2131755200;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 2131755201;
public static final int Base_Widget_AppCompat_RatingBar_Small = 2131755202;
public static final int Base_Widget_AppCompat_SearchView = 2131755203;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 2131755204;
public static final int Base_Widget_AppCompat_SeekBar = 2131755205;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 2131755206;
public static final int Base_Widget_AppCompat_Spinner = 2131755207;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 2131755208;
public static final int Base_Widget_AppCompat_TextView = 2131755209;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 2131755210;
public static final int Base_Widget_AppCompat_Toolbar = 2131755211;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131755212;
public static final int Base_Widget_Design_TabLayout = 2131755213;
public static final int Base_Widget_MaterialComponents_AutoCompleteTextView = 2131755214;
public static final int Base_Widget_MaterialComponents_CheckedTextView = 2131755215;
public static final int Base_Widget_MaterialComponents_Chip = 2131755216;
public static final int Base_Widget_MaterialComponents_PopupMenu = 2131755217;
public static final int Base_Widget_MaterialComponents_PopupMenu_ContextMenu = 2131755218;
public static final int Base_Widget_MaterialComponents_PopupMenu_ListPopupWindow = 2131755219;
public static final int Base_Widget_MaterialComponents_PopupMenu_Overflow = 2131755220;
public static final int Base_Widget_MaterialComponents_TextInputEditText = 2131755221;
public static final int Base_Widget_MaterialComponents_TextInputLayout = 2131755222;
public static final int Base_Widget_MaterialComponents_TextView = 2131755223;
public static final int CardView = 2131755224;
public static final int CardView_Dark = 2131755225;
public static final int CardView_Light = 2131755226;
public static final int EmptyTheme = 2131755227;
public static final int MaterialAlertDialog_MaterialComponents = 2131755228;
public static final int MaterialAlertDialog_MaterialComponents_Body_Text = 2131755229;
public static final int MaterialAlertDialog_MaterialComponents_Picker_Date_Calendar = 2131755230;
public static final int MaterialAlertDialog_MaterialComponents_Picker_Date_Spinner = 2131755231;
public static final int MaterialAlertDialog_MaterialComponents_Title_Icon = 2131755232;
public static final int MaterialAlertDialog_MaterialComponents_Title_Icon_CenterStacked = 2131755233;
public static final int MaterialAlertDialog_MaterialComponents_Title_Panel = 2131755234;
public static final int MaterialAlertDialog_MaterialComponents_Title_Panel_CenterStacked = 2131755235;
public static final int MaterialAlertDialog_MaterialComponents_Title_Text = 2131755236;
public static final int MaterialAlertDialog_MaterialComponents_Title_Text_CenterStacked = 2131755237;
public static final int Platform_AppCompat = 2131755238;
public static final int Platform_AppCompat_Light = 2131755239;
public static final int Platform_MaterialComponents = 2131755240;
public static final int Platform_MaterialComponents_Dialog = 2131755241;
public static final int Platform_MaterialComponents_Light = 2131755242;
public static final int Platform_MaterialComponents_Light_Dialog = 2131755243;
public static final int Platform_ThemeOverlay_AppCompat = 2131755244;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 2131755245;
public static final int Platform_ThemeOverlay_AppCompat_Light = 2131755246;
public static final int Platform_V21_AppCompat = 2131755247;
public static final int Platform_V21_AppCompat_Light = 2131755248;
public static final int Platform_V25_AppCompat = 2131755249;
public static final int Platform_V25_AppCompat_Light = 2131755250;
public static final int Platform_Widget_AppCompat_Spinner = 2131755251;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 2131755252;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131755253;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131755254;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131755255;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131755256;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 2131755257;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 2131755258;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131755259;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 2131755260;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131755261;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131755262;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131755263;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131755264;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131755265;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131755266;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 2131755267;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131755268;
public static final int ShapeAppearance_MaterialComponents = 2131755269;
public static final int ShapeAppearance_MaterialComponents_LargeComponent = 2131755270;
public static final int ShapeAppearance_MaterialComponents_MediumComponent = 2131755271;
public static final int ShapeAppearance_MaterialComponents_SmallComponent = 2131755272;
public static final int ShapeAppearance_MaterialComponents_Test = 2131755273;
public static final int ShapeAppearanceOverlay = 2131755274;
public static final int ShapeAppearanceOverlay_BottomLeftDifferentCornerSize = 2131755275;
public static final int ShapeAppearanceOverlay_BottomRightCut = 2131755276;
public static final int ShapeAppearanceOverlay_Cut = 2131755277;
public static final int ShapeAppearanceOverlay_DifferentCornerSize = 2131755278;
public static final int ShapeAppearanceOverlay_MaterialComponents_BottomSheet = 2131755279;
public static final int ShapeAppearanceOverlay_MaterialComponents_Chip = 2131755280;
public static final int ShapeAppearanceOverlay_MaterialComponents_ExtendedFloatingActionButton = 2131755281;
public static final int ShapeAppearanceOverlay_MaterialComponents_FloatingActionButton = 2131755282;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Day = 2131755283;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Window_Fullscreen = 2131755284;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Year = 2131755285;
public static final int ShapeAppearanceOverlay_MaterialComponents_TextInputLayout_FilledBox = 2131755286;
public static final int ShapeAppearanceOverlay_TopLeftCut = 2131755287;
public static final int ShapeAppearanceOverlay_TopRightDifferentCornerSize = 2131755288;
public static final int Test_ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Day = 2131755289;
public static final int Test_Theme_MaterialComponents_MaterialCalendar = 2131755290;
public static final int Test_Widget_MaterialComponents_MaterialCalendar = 2131755291;
public static final int Test_Widget_MaterialComponents_MaterialCalendar_Day = 2131755292;
public static final int Test_Widget_MaterialComponents_MaterialCalendar_Day_Selected = 2131755293;
public static final int TestStyleWithLineHeight = 2131755294;
public static final int TestStyleWithLineHeightAppearance = 2131755295;
public static final int TestStyleWithThemeLineHeightAttribute = 2131755296;
public static final int TestStyleWithoutLineHeight = 2131755297;
public static final int TestThemeWithLineHeight = 2131755298;
public static final int TestThemeWithLineHeightDisabled = 2131755299;
public static final int TextAppearance_AppCompat = 2131755300;
public static final int TextAppearance_AppCompat_Body1 = 2131755301;
public static final int TextAppearance_AppCompat_Body2 = 2131755302;
public static final int TextAppearance_AppCompat_Button = 2131755303;
public static final int TextAppearance_AppCompat_Caption = 2131755304;
public static final int TextAppearance_AppCompat_Display1 = 2131755305;
public static final int TextAppearance_AppCompat_Display2 = 2131755306;
public static final int TextAppearance_AppCompat_Display3 = 2131755307;
public static final int TextAppearance_AppCompat_Display4 = 2131755308;
public static final int TextAppearance_AppCompat_Headline = 2131755309;
public static final int TextAppearance_AppCompat_Inverse = 2131755310;
public static final int TextAppearance_AppCompat_Large = 2131755311;
public static final int TextAppearance_AppCompat_Large_Inverse = 2131755312;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131755313;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 2131755314;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131755315;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131755316;
public static final int TextAppearance_AppCompat_Medium = 2131755317;
public static final int TextAppearance_AppCompat_Medium_Inverse = 2131755318;
public static final int TextAppearance_AppCompat_Menu = 2131755319;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 2131755320;
public static final int TextAppearance_AppCompat_SearchResult_Title = 2131755321;
public static final int TextAppearance_AppCompat_Small = 2131755322;
public static final int TextAppearance_AppCompat_Small_Inverse = 2131755323;
public static final int TextAppearance_AppCompat_Subhead = 2131755324;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 2131755325;
public static final int TextAppearance_AppCompat_Title = 2131755326;
public static final int TextAppearance_AppCompat_Title_Inverse = 2131755327;
public static final int TextAppearance_AppCompat_Tooltip = 2131755328;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131755329;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131755330;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131755331;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131755332;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131755333;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131755334;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131755335;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131755336;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131755337;
public static final int TextAppearance_AppCompat_Widget_Button = 2131755338;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131755339;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 2131755340;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 2131755341;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 2131755342;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131755343;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131755344;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131755345;
public static final int TextAppearance_AppCompat_Widget_Switch = 2131755346;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131755347;
public static final int TextAppearance_Compat_Notification = 2131755348;
public static final int TextAppearance_Compat_Notification_Info = 2131755349;
public static final int TextAppearance_Compat_Notification_Line2 = 2131755350;
public static final int TextAppearance_Compat_Notification_Time = 2131755351;
public static final int TextAppearance_Compat_Notification_Title = 2131755352;
public static final int TextAppearance_Design_CollapsingToolbar_Expanded = 2131755353;
public static final int TextAppearance_Design_Counter = 2131755354;
public static final int TextAppearance_Design_Counter_Overflow = 2131755355;
public static final int TextAppearance_Design_Error = 2131755356;
public static final int TextAppearance_Design_HelperText = 2131755357;
public static final int TextAppearance_Design_Hint = 2131755358;
public static final int TextAppearance_Design_Snackbar_Message = 2131755359;
public static final int TextAppearance_Design_Tab = 2131755360;
public static final int TextAppearance_MaterialComponents_Badge = 2131755361;
public static final int TextAppearance_MaterialComponents_Body1 = 2131755362;
public static final int TextAppearance_MaterialComponents_Body2 = 2131755363;
public static final int TextAppearance_MaterialComponents_Button = 2131755364;
public static final int TextAppearance_MaterialComponents_Caption = 2131755365;
public static final int TextAppearance_MaterialComponents_Chip = 2131755366;
public static final int TextAppearance_MaterialComponents_Headline1 = 2131755367;
public static final int TextAppearance_MaterialComponents_Headline2 = 2131755368;
public static final int TextAppearance_MaterialComponents_Headline3 = 2131755369;
public static final int TextAppearance_MaterialComponents_Headline4 = 2131755370;
public static final int TextAppearance_MaterialComponents_Headline5 = 2131755371;
public static final int TextAppearance_MaterialComponents_Headline6 = 2131755372;
public static final int TextAppearance_MaterialComponents_Overline = 2131755373;
public static final int TextAppearance_MaterialComponents_Subtitle1 = 2131755374;
public static final int TextAppearance_MaterialComponents_Subtitle2 = 2131755375;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131755376;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131755377;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131755378;
public static final int Theme_AppCompat = 2131755379;
public static final int Theme_AppCompat_CompactMenu = 2131755380;
public static final int Theme_AppCompat_DayNight = 2131755381;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 2131755382;
public static final int Theme_AppCompat_DayNight_Dialog = 2131755383;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 2131755384;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131755385;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 2131755386;
public static final int Theme_AppCompat_DayNight_NoActionBar = 2131755387;
public static final int Theme_AppCompat_Dialog = 2131755388;
public static final int Theme_AppCompat_Dialog_Alert = 2131755389;
public static final int Theme_AppCompat_Dialog_MinWidth = 2131755390;
public static final int Theme_AppCompat_DialogWhenLarge = 2131755391;
public static final int Theme_AppCompat_Light = 2131755392;
public static final int Theme_AppCompat_Light_DarkActionBar = 2131755393;
public static final int Theme_AppCompat_Light_Dialog = 2131755394;
public static final int Theme_AppCompat_Light_Dialog_Alert = 2131755395;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 2131755396;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 2131755397;
public static final int Theme_AppCompat_Light_NoActionBar = 2131755398;
public static final int Theme_AppCompat_NoActionBar = 2131755399;
public static final int Theme_Design = 2131755400;
public static final int Theme_Design_BottomSheetDialog = 2131755401;
public static final int Theme_Design_Light = 2131755402;
public static final int Theme_Design_Light_BottomSheetDialog = 2131755403;
public static final int Theme_Design_Light_NoActionBar = 2131755404;
public static final int Theme_Design_NoActionBar = 2131755405;
public static final int Theme_MaterialComponents = 2131755406;
public static final int Theme_MaterialComponents_BottomSheetDialog = 2131755407;
public static final int Theme_MaterialComponents_Bridge = 2131755408;
public static final int Theme_MaterialComponents_CompactMenu = 2131755409;
public static final int Theme_MaterialComponents_DayNight = 2131755410;
public static final int Theme_MaterialComponents_DayNight_BottomSheetDialog = 2131755411;
public static final int Theme_MaterialComponents_DayNight_Bridge = 2131755412;
public static final int Theme_MaterialComponents_DayNight_DarkActionBar = 2131755413;
public static final int Theme_MaterialComponents_DayNight_DarkActionBar_Bridge = 2131755414;
public static final int Theme_MaterialComponents_DayNight_Dialog = 2131755415;
public static final int Theme_MaterialComponents_DayNight_Dialog_Alert = 2131755416;
public static final int Theme_MaterialComponents_DayNight_Dialog_Alert_Bridge = 2131755417;
public static final int Theme_MaterialComponents_DayNight_Dialog_Bridge = 2131755418;
public static final int Theme_MaterialComponents_DayNight_Dialog_FixedSize = 2131755419;
public static final int Theme_MaterialComponents_DayNight_Dialog_FixedSize_Bridge = 2131755420;
public static final int Theme_MaterialComponents_DayNight_Dialog_MinWidth = 2131755421;
public static final int Theme_MaterialComponents_DayNight_Dialog_MinWidth_Bridge = 2131755422;
public static final int Theme_MaterialComponents_DayNight_DialogWhenLarge = 2131755423;
public static final int Theme_MaterialComponents_DayNight_NoActionBar = 2131755424;
public static final int Theme_MaterialComponents_DayNight_NoActionBar_Bridge = 2131755425;
public static final int Theme_MaterialComponents_Dialog = 2131755426;
public static final int Theme_MaterialComponents_Dialog_Alert = 2131755427;
public static final int Theme_MaterialComponents_Dialog_Alert_Bridge = 2131755428;
public static final int Theme_MaterialComponents_Dialog_Bridge = 2131755429;
public static final int Theme_MaterialComponents_Dialog_FixedSize = 2131755430;
public static final int Theme_MaterialComponents_Dialog_FixedSize_Bridge = 2131755431;
public static final int Theme_MaterialComponents_Dialog_MinWidth = 2131755432;
public static final int Theme_MaterialComponents_Dialog_MinWidth_Bridge = 2131755433;
public static final int Theme_MaterialComponents_DialogWhenLarge = 2131755434;
public static final int Theme_MaterialComponents_Light = 2131755435;
public static final int Theme_MaterialComponents_Light_BarSize = 2131755436;
public static final int Theme_MaterialComponents_Light_BottomSheetDialog = 2131755437;
public static final int Theme_MaterialComponents_Light_Bridge = 2131755438;
public static final int Theme_MaterialComponents_Light_DarkActionBar = 2131755439;
public static final int Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755440;
public static final int Theme_MaterialComponents_Light_Dialog = 2131755441;
public static final int Theme_MaterialComponents_Light_Dialog_Alert = 2131755442;
public static final int Theme_MaterialComponents_Light_Dialog_Alert_Bridge = 2131755443;
public static final int Theme_MaterialComponents_Light_Dialog_Bridge = 2131755444;
public static final int Theme_MaterialComponents_Light_Dialog_FixedSize = 2131755445;
public static final int Theme_MaterialComponents_Light_Dialog_FixedSize_Bridge = 2131755446;
public static final int Theme_MaterialComponents_Light_Dialog_MinWidth = 2131755447;
public static final int Theme_MaterialComponents_Light_Dialog_MinWidth_Bridge = 2131755448;
public static final int Theme_MaterialComponents_Light_DialogWhenLarge = 2131755449;
public static final int Theme_MaterialComponents_Light_LargeTouch = 2131755450;
public static final int Theme_MaterialComponents_Light_NoActionBar = 2131755451;
public static final int Theme_MaterialComponents_Light_NoActionBar_Bridge = 2131755452;
public static final int Theme_MaterialComponents_NoActionBar = 2131755453;
public static final int Theme_MaterialComponents_NoActionBar_Bridge = 2131755454;
public static final int Theme_MyApplicationTest = 2131755455;
public static final int ThemeOverlay_AppCompat = 2131755456;
public static final int ThemeOverlay_AppCompat_ActionBar = 2131755457;
public static final int ThemeOverlay_AppCompat_Dark = 2131755458;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 2131755459;
public static final int ThemeOverlay_AppCompat_DayNight = 2131755460;
public static final int ThemeOverlay_AppCompat_DayNight_ActionBar = 2131755461;
public static final int ThemeOverlay_AppCompat_Dialog = 2131755462;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 2131755463;
public static final int ThemeOverlay_AppCompat_Light = 2131755464;
public static final int ThemeOverlay_Design_TextInputEditText = 2131755465;
public static final int ThemeOverlay_MaterialComponents = 2131755466;
public static final int ThemeOverlay_MaterialComponents_ActionBar = 2131755467;
public static final int ThemeOverlay_MaterialComponents_ActionBar_Primary = 2131755468;
public static final int ThemeOverlay_MaterialComponents_ActionBar_Surface = 2131755469;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView = 2131755470;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_FilledBox = 2131755471;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_FilledBox_Dense = 2131755472;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_OutlinedBox = 2131755473;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_OutlinedBox_Dense = 2131755474;
public static final int ThemeOverlay_MaterialComponents_BottomAppBar_Primary = 2131755475;
public static final int ThemeOverlay_MaterialComponents_BottomAppBar_Surface = 2131755476;
public static final int ThemeOverlay_MaterialComponents_BottomSheetDialog = 2131755477;
public static final int ThemeOverlay_MaterialComponents_Dark = 2131755478;
public static final int ThemeOverlay_MaterialComponents_Dark_ActionBar = 2131755479;
public static final int ThemeOverlay_MaterialComponents_DayNight_BottomSheetDialog = 2131755480;
public static final int ThemeOverlay_MaterialComponents_Dialog = 2131755481;
public static final int ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755482;
public static final int ThemeOverlay_MaterialComponents_Light = 2131755483;
public static final int ThemeOverlay_MaterialComponents_Light_BottomSheetDialog = 2131755484;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755485;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Centered = 2131755486;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date = 2131755487;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Calendar = 2131755488;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Header_Text = 2131755489;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Header_Text_Day = 2131755490;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Spinner = 2131755491;
public static final int ThemeOverlay_MaterialComponents_MaterialCalendar = 2131755492;
public static final int ThemeOverlay_MaterialComponents_MaterialCalendar_Fullscreen = 2131755493;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText = 2131755494;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_FilledBox = 2131755495;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_FilledBox_Dense = 2131755496;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_OutlinedBox = 2131755497;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_OutlinedBox_Dense = 2131755498;
public static final int ThemeOverlay_MaterialComponents_Toolbar_Primary = 2131755499;
public static final int ThemeOverlay_MaterialComponents_Toolbar_Surface = 2131755500;
public static final int Widget_AppCompat_ActionBar = 2131755501;
public static final int Widget_AppCompat_ActionBar_Solid = 2131755502;
public static final int Widget_AppCompat_ActionBar_TabBar = 2131755503;
public static final int Widget_AppCompat_ActionBar_TabText = 2131755504;
public static final int Widget_AppCompat_ActionBar_TabView = 2131755505;
public static final int Widget_AppCompat_ActionButton = 2131755506;
public static final int Widget_AppCompat_ActionButton_CloseMode = 2131755507;
public static final int Widget_AppCompat_ActionButton_Overflow = 2131755508;
public static final int Widget_AppCompat_ActionMode = 2131755509;
public static final int Widget_AppCompat_ActivityChooserView = 2131755510;
public static final int Widget_AppCompat_AutoCompleteTextView = 2131755511;
public static final int Widget_AppCompat_Button = 2131755512;
public static final int Widget_AppCompat_Button_Borderless = 2131755513;
public static final int Widget_AppCompat_Button_Borderless_Colored = 2131755514;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131755515;
public static final int Widget_AppCompat_Button_Colored = 2131755516;
public static final int Widget_AppCompat_Button_Small = 2131755517;
public static final int Widget_AppCompat_ButtonBar = 2131755518;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 2131755519;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 2131755520;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 2131755521;
public static final int Widget_AppCompat_CompoundButton_Switch = 2131755522;
public static final int Widget_AppCompat_DrawerArrowToggle = 2131755523;
public static final int Widget_AppCompat_DropDownItem_Spinner = 2131755524;
public static final int Widget_AppCompat_EditText = 2131755525;
public static final int Widget_AppCompat_ImageButton = 2131755526;
public static final int Widget_AppCompat_Light_ActionBar = 2131755527;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 2131755528;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131755529;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 2131755530;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131755531;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 2131755532;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131755533;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 2131755534;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131755535;
public static final int Widget_AppCompat_Light_ActionButton = 2131755536;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 2131755537;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 2131755538;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 2131755539;
public static final int Widget_AppCompat_Light_ActivityChooserView = 2131755540;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 2131755541;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 2131755542;
public static final int Widget_AppCompat_Light_ListPopupWindow = 2131755543;
public static final int Widget_AppCompat_Light_ListView_DropDown = 2131755544;
public static final int Widget_AppCompat_Light_PopupMenu = 2131755545;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 2131755546;
public static final int Widget_AppCompat_Light_SearchView = 2131755547;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131755548;
public static final int Widget_AppCompat_ListMenuView = 2131755549;
public static final int Widget_AppCompat_ListPopupWindow = 2131755550;
public static final int Widget_AppCompat_ListView = 2131755551;
public static final int Widget_AppCompat_ListView_DropDown = 2131755552;
public static final int Widget_AppCompat_ListView_Menu = 2131755553;
public static final int Widget_AppCompat_PopupMenu = 2131755554;
public static final int Widget_AppCompat_PopupMenu_Overflow = 2131755555;
public static final int Widget_AppCompat_PopupWindow = 2131755556;
public static final int Widget_AppCompat_ProgressBar = 2131755557;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 2131755558;
public static final int Widget_AppCompat_RatingBar = 2131755559;
public static final int Widget_AppCompat_RatingBar_Indicator = 2131755560;
public static final int Widget_AppCompat_RatingBar_Small = 2131755561;
public static final int Widget_AppCompat_SearchView = 2131755562;
public static final int Widget_AppCompat_SearchView_ActionBar = 2131755563;
public static final int Widget_AppCompat_SeekBar = 2131755564;
public static final int Widget_AppCompat_SeekBar_Discrete = 2131755565;
public static final int Widget_AppCompat_Spinner = 2131755566;
public static final int Widget_AppCompat_Spinner_DropDown = 2131755567;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131755568;
public static final int Widget_AppCompat_Spinner_Underlined = 2131755569;
public static final int Widget_AppCompat_TextView = 2131755570;
public static final int Widget_AppCompat_TextView_SpinnerItem = 2131755571;
public static final int Widget_AppCompat_Toolbar = 2131755572;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 2131755573;
public static final int Widget_Compat_NotificationActionContainer = 2131755574;
public static final int Widget_Compat_NotificationActionText = 2131755575;
public static final int Widget_Design_AppBarLayout = 2131755576;
public static final int Widget_Design_BottomNavigationView = 2131755577;
public static final int Widget_Design_BottomSheet_Modal = 2131755578;
public static final int Widget_Design_CollapsingToolbar = 2131755579;
public static final int Widget_Design_FloatingActionButton = 2131755580;
public static final int Widget_Design_NavigationView = 2131755581;
public static final int Widget_Design_ScrimInsetsFrameLayout = 2131755582;
public static final int Widget_Design_Snackbar = 2131755583;
public static final int Widget_Design_TabLayout = 2131755584;
public static final int Widget_Design_TextInputLayout = 2131755585;
public static final int Widget_MaterialComponents_ActionBar_Primary = 2131755586;
public static final int Widget_MaterialComponents_ActionBar_PrimarySurface = 2131755587;
public static final int Widget_MaterialComponents_ActionBar_Solid = 2131755588;
public static final int Widget_MaterialComponents_ActionBar_Surface = 2131755589;
public static final int Widget_MaterialComponents_AppBarLayout_Primary = 2131755590;
public static final int Widget_MaterialComponents_AppBarLayout_PrimarySurface = 2131755591;
public static final int Widget_MaterialComponents_AppBarLayout_Surface = 2131755592;
public static final int Widget_MaterialComponents_AutoCompleteTextView_FilledBox = 2131755593;
public static final int Widget_MaterialComponents_AutoCompleteTextView_FilledBox_Dense = 2131755594;
public static final int Widget_MaterialComponents_AutoCompleteTextView_OutlinedBox = 2131755595;
public static final int Widget_MaterialComponents_AutoCompleteTextView_OutlinedBox_Dense = 2131755596;
public static final int Widget_MaterialComponents_Badge = 2131755597;
public static final int Widget_MaterialComponents_BottomAppBar = 2131755598;
public static final int Widget_MaterialComponents_BottomAppBar_Colored = 2131755599;
public static final int Widget_MaterialComponents_BottomAppBar_PrimarySurface = 2131755600;
public static final int Widget_MaterialComponents_BottomNavigationView = 2131755601;
public static final int Widget_MaterialComponents_BottomNavigationView_Colored = 2131755602;
public static final int Widget_MaterialComponents_BottomNavigationView_PrimarySurface = 2131755603;
public static final int Widget_MaterialComponents_BottomSheet = 2131755604;
public static final int Widget_MaterialComponents_BottomSheet_Modal = 2131755605;
public static final int Widget_MaterialComponents_Button = 2131755606;
public static final int Widget_MaterialComponents_Button_Icon = 2131755607;
public static final int Widget_MaterialComponents_Button_OutlinedButton = 2131755608;
public static final int Widget_MaterialComponents_Button_OutlinedButton_Icon = 2131755609;
public static final int Widget_MaterialComponents_Button_TextButton = 2131755610;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog = 2131755611;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog_Flush = 2131755612;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog_Icon = 2131755613;
public static final int Widget_MaterialComponents_Button_TextButton_Icon = 2131755614;
public static final int Widget_MaterialComponents_Button_TextButton_Snackbar = 2131755615;
public static final int Widget_MaterialComponents_Button_UnelevatedButton = 2131755616;
public static final int Widget_MaterialComponents_Button_UnelevatedButton_Icon = 2131755617;
public static final int Widget_MaterialComponents_CardView = 2131755618;
public static final int Widget_MaterialComponents_CheckedTextView = 2131755619;
public static final int Widget_MaterialComponents_Chip_Action = 2131755620;
public static final int Widget_MaterialComponents_Chip_Choice = 2131755621;
public static final int Widget_MaterialComponents_Chip_Entry = 2131755622;
public static final int Widget_MaterialComponents_Chip_Filter = 2131755623;
public static final int Widget_MaterialComponents_ChipGroup = 2131755624;
public static final int Widget_MaterialComponents_CompoundButton_CheckBox = 2131755625;
public static final int Widget_MaterialComponents_CompoundButton_RadioButton = 2131755626;
public static final int Widget_MaterialComponents_CompoundButton_Switch = 2131755627;
public static final int Widget_MaterialComponents_ExtendedFloatingActionButton = 2131755628;
public static final int Widget_MaterialComponents_ExtendedFloatingActionButton_Icon = 2131755629;
public static final int Widget_MaterialComponents_FloatingActionButton = 2131755630;
public static final int Widget_MaterialComponents_Light_ActionBar_Solid = 2131755631;
public static final int Widget_MaterialComponents_MaterialButtonToggleGroup = 2131755632;
public static final int Widget_MaterialComponents_MaterialCalendar = 2131755633;
public static final int Widget_MaterialComponents_MaterialCalendar_Day = 2131755634;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Invalid = 2131755635;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Selected = 2131755636;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Today = 2131755637;
public static final int Widget_MaterialComponents_MaterialCalendar_DayTextView = 2131755638;
public static final int Widget_MaterialComponents_MaterialCalendar_Fullscreen = 2131755639;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderConfirmButton = 2131755640;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderDivider = 2131755641;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderLayout = 2131755642;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderSelection = 2131755643;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderSelection_Fullscreen = 2131755644;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderTitle = 2131755645;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderToggleButton = 2131755646;
public static final int Widget_MaterialComponents_MaterialCalendar_Item = 2131755647;
public static final int Widget_MaterialComponents_MaterialCalendar_Year = 2131755648;
public static final int Widget_MaterialComponents_MaterialCalendar_Year_Selected = 2131755649;
public static final int Widget_MaterialComponents_MaterialCalendar_Year_Today = 2131755650;
public static final int Widget_MaterialComponents_NavigationView = 2131755651;
public static final int Widget_MaterialComponents_PopupMenu = 2131755652;
public static final int Widget_MaterialComponents_PopupMenu_ContextMenu = 2131755653;
public static final int Widget_MaterialComponents_PopupMenu_ListPopupWindow = 2131755654;
public static final int Widget_MaterialComponents_PopupMenu_Overflow = 2131755655;
public static final int Widget_MaterialComponents_Snackbar = 2131755656;
public static final int Widget_MaterialComponents_Snackbar_FullWidth = 2131755657;
public static final int Widget_MaterialComponents_TabLayout = 2131755658;
public static final int Widget_MaterialComponents_TabLayout_Colored = 2131755659;
public static final int Widget_MaterialComponents_TabLayout_PrimarySurface = 2131755660;
public static final int Widget_MaterialComponents_TextInputEditText_FilledBox = 2131755661;
public static final int Widget_MaterialComponents_TextInputEditText_FilledBox_Dense = 2131755662;
public static final int Widget_MaterialComponents_TextInputEditText_OutlinedBox = 2131755663;
public static final int Widget_MaterialComponents_TextInputEditText_OutlinedBox_Dense = 2131755664;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox = 2131755665;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_Dense = 2131755666;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_Dense_ExposedDropdownMenu = 2131755667;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_ExposedDropdownMenu = 2131755668;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox = 2131755669;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_Dense = 2131755670;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_Dense_ExposedDropdownMenu = 2131755671;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_ExposedDropdownMenu = 2131755672;
public static final int Widget_MaterialComponents_TextView = 2131755673;
public static final int Widget_MaterialComponents_Toolbar = 2131755674;
public static final int Widget_MaterialComponents_Toolbar_Primary = 2131755675;
public static final int Widget_MaterialComponents_Toolbar_PrimarySurface = 2131755676;
public static final int Widget_MaterialComponents_Toolbar_Surface = 2131755677;
public static final int Widget_Support_CoordinatorLayout = 2131755678;
}
public static final class xml {
public static final int accessibility_service_config = 2131886080;
public static final int standalone_badge = 2131886081;
public static final int standalone_badge_gravity_bottom_end = 2131886082;
public static final int standalone_badge_gravity_bottom_start = 2131886083;
public static final int standalone_badge_gravity_top_start = 2131886084;
}
}
| UTF-8 | Java | 196,752 | java | R.java | Java | [
{
"context": " public static final int $avd_hide_password__0 = 2131165184;\n public static final int $avd_hide_passwo",
"end": 88969,
"score": 0.9994378089904785,
"start": 88959,
"tag": "PASSWORD",
"value": "2131165184"
},
{
"context": " public static final int $avd_hide_pas... | null | [] | package divide.maze.maze;
/* This class is generated by JADX */
public final class R {
public static final class anim {
public static final int abc_fade_in = 2130771968;
public static final int abc_fade_out = 2130771969;
public static final int abc_grow_fade_in_from_bottom = 2130771970;
public static final int abc_popup_enter = 2130771971;
public static final int abc_popup_exit = 2130771972;
public static final int abc_shrink_fade_out_from_bottom = 2130771973;
public static final int abc_slide_in_bottom = 2130771974;
public static final int abc_slide_in_top = 2130771975;
public static final int abc_slide_out_bottom = 2130771976;
public static final int abc_slide_out_top = 2130771977;
public static final int abc_tooltip_enter = 2130771978;
public static final int abc_tooltip_exit = 2130771979;
public static final int btn_checkbox_to_checked_box_inner_merged_animation = 2130771980;
public static final int btn_checkbox_to_checked_box_outer_merged_animation = 2130771981;
public static final int btn_checkbox_to_checked_icon_null_animation = 2130771982;
public static final int btn_checkbox_to_unchecked_box_inner_merged_animation = 2130771983;
public static final int btn_checkbox_to_unchecked_check_path_merged_animation = 2130771984;
public static final int btn_checkbox_to_unchecked_icon_null_animation = 2130771985;
public static final int btn_radio_to_off_mtrl_dot_group_animation = 2130771986;
public static final int btn_radio_to_off_mtrl_ring_outer_animation = 2130771987;
public static final int btn_radio_to_off_mtrl_ring_outer_path_animation = 2130771988;
public static final int btn_radio_to_on_mtrl_dot_group_animation = 2130771989;
public static final int btn_radio_to_on_mtrl_ring_outer_animation = 2130771990;
public static final int btn_radio_to_on_mtrl_ring_outer_path_animation = 2130771991;
public static final int design_bottom_sheet_slide_in = 2130771992;
public static final int design_bottom_sheet_slide_out = 2130771993;
public static final int design_snackbar_in = 2130771994;
public static final int design_snackbar_out = 2130771995;
public static final int mtrl_bottom_sheet_slide_in = 2130771996;
public static final int mtrl_bottom_sheet_slide_out = 2130771997;
public static final int mtrl_card_lowers_interpolator = 2130771998;
}
public static final class animator {
public static final int design_appbar_state_list_animator = 2130837504;
public static final int design_fab_hide_motion_spec = 2130837505;
public static final int design_fab_show_motion_spec = 2130837506;
public static final int mtrl_btn_state_list_anim = 2130837507;
public static final int mtrl_btn_unelevated_state_list_anim = 2130837508;
public static final int mtrl_card_state_list_anim = 2130837509;
public static final int mtrl_chip_state_list_anim = 2130837510;
public static final int mtrl_extended_fab_change_size_motion_spec = 2130837511;
public static final int mtrl_extended_fab_hide_motion_spec = 2130837512;
public static final int mtrl_extended_fab_show_motion_spec = 2130837513;
public static final int mtrl_extended_fab_state_list_animator = 2130837514;
public static final int mtrl_fab_hide_motion_spec = 2130837515;
public static final int mtrl_fab_show_motion_spec = 2130837516;
public static final int mtrl_fab_transformation_sheet_collapse_spec = 2130837517;
public static final int mtrl_fab_transformation_sheet_expand_spec = 2130837518;
}
public static final class attr {
public static final int actionBarDivider = 2130903040;
public static final int actionBarItemBackground = 2130903041;
public static final int actionBarPopupTheme = 2130903042;
public static final int actionBarSize = 2130903043;
public static final int actionBarSplitStyle = 2130903044;
public static final int actionBarStyle = 2130903045;
public static final int actionBarTabBarStyle = 2130903046;
public static final int actionBarTabStyle = 2130903047;
public static final int actionBarTabTextStyle = 2130903048;
public static final int actionBarTheme = 2130903049;
public static final int actionBarWidgetTheme = 2130903050;
public static final int actionButtonStyle = 2130903051;
public static final int actionDropDownStyle = 2130903052;
public static final int actionLayout = 2130903053;
public static final int actionMenuTextAppearance = 2130903054;
public static final int actionMenuTextColor = 2130903055;
public static final int actionModeBackground = 2130903056;
public static final int actionModeCloseButtonStyle = 2130903057;
public static final int actionModeCloseDrawable = 2130903058;
public static final int actionModeCopyDrawable = 2130903059;
public static final int actionModeCutDrawable = 2130903060;
public static final int actionModeFindDrawable = 2130903061;
public static final int actionModePasteDrawable = 2130903062;
public static final int actionModePopupWindowStyle = 2130903063;
public static final int actionModeSelectAllDrawable = 2130903064;
public static final int actionModeShareDrawable = 2130903065;
public static final int actionModeSplitBackground = 2130903066;
public static final int actionModeStyle = 2130903067;
public static final int actionModeWebSearchDrawable = 2130903068;
public static final int actionOverflowButtonStyle = 2130903069;
public static final int actionOverflowMenuStyle = 2130903070;
public static final int actionProviderClass = 2130903071;
public static final int actionTextColorAlpha = 2130903072;
public static final int actionViewClass = 2130903073;
public static final int activityChooserViewStyle = 2130903074;
public static final int alertDialogButtonGroupStyle = 2130903075;
public static final int alertDialogCenterButtons = 2130903076;
public static final int alertDialogStyle = 2130903077;
public static final int alertDialogTheme = 2130903078;
public static final int allowStacking = 2130903079;
public static final int alpha = 2130903080;
public static final int alphabeticModifiers = 2130903081;
public static final int animationMode = 2130903082;
public static final int appBarLayoutStyle = 2130903083;
public static final int arrowHeadLength = 2130903084;
public static final int arrowShaftLength = 2130903085;
public static final int autoCompleteTextViewStyle = 2130903086;
public static final int autoSizeMaxTextSize = 2130903087;
public static final int autoSizeMinTextSize = 2130903088;
public static final int autoSizePresetSizes = 2130903089;
public static final int autoSizeStepGranularity = 2130903090;
public static final int autoSizeTextType = 2130903091;
public static final int background = 2130903092;
public static final int backgroundColor = 2130903093;
public static final int backgroundInsetBottom = 2130903094;
public static final int backgroundInsetEnd = 2130903095;
public static final int backgroundInsetStart = 2130903096;
public static final int backgroundInsetTop = 2130903097;
public static final int backgroundOverlayColorAlpha = 2130903098;
public static final int backgroundSplit = 2130903099;
public static final int backgroundStacked = 2130903100;
public static final int backgroundTint = 2130903101;
public static final int backgroundTintMode = 2130903102;
public static final int badgeGravity = 2130903103;
public static final int badgeStyle = 2130903104;
public static final int badgeTextColor = 2130903105;
public static final int barLength = 2130903106;
public static final int barrierAllowsGoneWidgets = 2130903107;
public static final int barrierDirection = 2130903108;
public static final int behavior_autoHide = 2130903109;
public static final int behavior_autoShrink = 2130903110;
public static final int behavior_expandedOffset = 2130903111;
public static final int behavior_fitToContents = 2130903112;
public static final int behavior_halfExpandedRatio = 2130903113;
public static final int behavior_hideable = 2130903114;
public static final int behavior_overlapTop = 2130903115;
public static final int behavior_peekHeight = 2130903116;
public static final int behavior_saveFlags = 2130903117;
public static final int behavior_skipCollapsed = 2130903118;
public static final int borderWidth = 2130903119;
public static final int borderlessButtonStyle = 2130903120;
public static final int bottomAppBarStyle = 2130903121;
public static final int bottomNavigationStyle = 2130903122;
public static final int bottomSheetDialogTheme = 2130903123;
public static final int bottomSheetStyle = 2130903124;
public static final int boxBackgroundColor = 2130903125;
public static final int boxBackgroundMode = 2130903126;
public static final int boxCollapsedPaddingTop = 2130903127;
public static final int boxCornerRadiusBottomEnd = 2130903128;
public static final int boxCornerRadiusBottomStart = 2130903129;
public static final int boxCornerRadiusTopEnd = 2130903130;
public static final int boxCornerRadiusTopStart = 2130903131;
public static final int boxStrokeColor = 2130903132;
public static final int boxStrokeWidth = 2130903133;
public static final int boxStrokeWidthFocused = 2130903134;
public static final int buttonBarButtonStyle = 2130903135;
public static final int buttonBarNegativeButtonStyle = 2130903136;
public static final int buttonBarNeutralButtonStyle = 2130903137;
public static final int buttonBarPositiveButtonStyle = 2130903138;
public static final int buttonBarStyle = 2130903139;
public static final int buttonCompat = 2130903140;
public static final int buttonGravity = 2130903141;
public static final int buttonIconDimen = 2130903142;
public static final int buttonPanelSideLayout = 2130903143;
public static final int buttonStyle = 2130903144;
public static final int buttonStyleSmall = 2130903145;
public static final int buttonTint = 2130903146;
public static final int buttonTintMode = 2130903147;
public static final int cardBackgroundColor = 2130903148;
public static final int cardCornerRadius = 2130903149;
public static final int cardElevation = 2130903150;
public static final int cardForegroundColor = 2130903151;
public static final int cardMaxElevation = 2130903152;
public static final int cardPreventCornerOverlap = 2130903153;
public static final int cardUseCompatPadding = 2130903154;
public static final int cardViewStyle = 2130903155;
public static final int chainUseRtl = 2130903156;
public static final int checkboxStyle = 2130903157;
public static final int checkedButton = 2130903158;
public static final int checkedChip = 2130903159;
public static final int checkedIcon = 2130903160;
public static final int checkedIconEnabled = 2130903161;
public static final int checkedIconTint = 2130903162;
public static final int checkedIconVisible = 2130903163;
public static final int checkedTextViewStyle = 2130903164;
public static final int chipBackgroundColor = 2130903165;
public static final int chipCornerRadius = 2130903166;
public static final int chipEndPadding = 2130903167;
public static final int chipGroupStyle = 2130903168;
public static final int chipIcon = 2130903169;
public static final int chipIconEnabled = 2130903170;
public static final int chipIconSize = 2130903171;
public static final int chipIconTint = 2130903172;
public static final int chipIconVisible = 2130903173;
public static final int chipMinHeight = 2130903174;
public static final int chipMinTouchTargetSize = 2130903175;
public static final int chipSpacing = 2130903176;
public static final int chipSpacingHorizontal = 2130903177;
public static final int chipSpacingVertical = 2130903178;
public static final int chipStandaloneStyle = 2130903179;
public static final int chipStartPadding = 2130903180;
public static final int chipStrokeColor = 2130903181;
public static final int chipStrokeWidth = 2130903182;
public static final int chipStyle = 2130903183;
public static final int chipSurfaceColor = 2130903184;
public static final int closeIcon = 2130903185;
public static final int closeIconEnabled = 2130903186;
public static final int closeIconEndPadding = 2130903187;
public static final int closeIconSize = 2130903188;
public static final int closeIconStartPadding = 2130903189;
public static final int closeIconTint = 2130903190;
public static final int closeIconVisible = 2130903191;
public static final int closeItemLayout = 2130903192;
public static final int collapseContentDescription = 2130903193;
public static final int collapseIcon = 2130903194;
public static final int collapsedTitleGravity = 2130903195;
public static final int collapsedTitleTextAppearance = 2130903196;
public static final int color = 2130903197;
public static final int colorAccent = 2130903198;
public static final int colorBackgroundFloating = 2130903199;
public static final int colorButtonNormal = 2130903200;
public static final int colorControlActivated = 2130903201;
public static final int colorControlHighlight = 2130903202;
public static final int colorControlNormal = 2130903203;
public static final int colorError = 2130903204;
public static final int colorOnBackground = 2130903205;
public static final int colorOnError = 2130903206;
public static final int colorOnPrimary = 2130903207;
public static final int colorOnPrimarySurface = 2130903208;
public static final int colorOnSecondary = 2130903209;
public static final int colorOnSurface = 2130903210;
public static final int colorPrimary = 2130903211;
public static final int colorPrimaryDark = 2130903212;
public static final int colorPrimarySurface = 2130903213;
public static final int colorPrimaryVariant = 2130903214;
public static final int colorSecondary = 2130903215;
public static final int colorSecondaryVariant = 2130903216;
public static final int colorSurface = 2130903217;
public static final int colorSwitchThumbNormal = 2130903218;
public static final int commitIcon = 2130903219;
public static final int constraintSet = 2130903220;
public static final int constraint_referenced_ids = 2130903221;
public static final int content = 2130903222;
public static final int contentDescription = 2130903223;
public static final int contentInsetEnd = 2130903224;
public static final int contentInsetEndWithActions = 2130903225;
public static final int contentInsetLeft = 2130903226;
public static final int contentInsetRight = 2130903227;
public static final int contentInsetStart = 2130903228;
public static final int contentInsetStartWithNavigation = 2130903229;
public static final int contentPadding = 2130903230;
public static final int contentPaddingBottom = 2130903231;
public static final int contentPaddingLeft = 2130903232;
public static final int contentPaddingRight = 2130903233;
public static final int contentPaddingTop = 2130903234;
public static final int contentScrim = 2130903235;
public static final int controlBackground = 2130903236;
public static final int coordinatorLayoutStyle = 2130903237;
public static final int cornerFamily = 2130903238;
public static final int cornerFamilyBottomLeft = 2130903239;
public static final int cornerFamilyBottomRight = 2130903240;
public static final int cornerFamilyTopLeft = 2130903241;
public static final int cornerFamilyTopRight = 2130903242;
public static final int cornerRadius = 2130903243;
public static final int cornerSize = 2130903244;
public static final int cornerSizeBottomLeft = 2130903245;
public static final int cornerSizeBottomRight = 2130903246;
public static final int cornerSizeTopLeft = 2130903247;
public static final int cornerSizeTopRight = 2130903248;
public static final int counterEnabled = 2130903249;
public static final int counterMaxLength = 2130903250;
public static final int counterOverflowTextAppearance = 2130903251;
public static final int counterOverflowTextColor = 2130903252;
public static final int counterTextAppearance = 2130903253;
public static final int counterTextColor = 2130903254;
public static final int customNavigationLayout = 2130903255;
public static final int dayInvalidStyle = 2130903256;
public static final int daySelectedStyle = 2130903257;
public static final int dayStyle = 2130903258;
public static final int dayTodayStyle = 2130903259;
public static final int defaultQueryHint = 2130903260;
public static final int dialogCornerRadius = 2130903261;
public static final int dialogPreferredPadding = 2130903262;
public static final int dialogTheme = 2130903263;
public static final int displayOptions = 2130903264;
public static final int divider = 2130903265;
public static final int dividerHorizontal = 2130903266;
public static final int dividerPadding = 2130903267;
public static final int dividerVertical = 2130903268;
public static final int drawableBottomCompat = 2130903269;
public static final int drawableEndCompat = 2130903270;
public static final int drawableLeftCompat = 2130903271;
public static final int drawableRightCompat = 2130903272;
public static final int drawableSize = 2130903273;
public static final int drawableStartCompat = 2130903274;
public static final int drawableTint = 2130903275;
public static final int drawableTintMode = 2130903276;
public static final int drawableTopCompat = 2130903277;
public static final int drawerArrowStyle = 2130903278;
public static final int dropDownListViewStyle = 2130903279;
public static final int dropdownListPreferredItemHeight = 2130903280;
public static final int editTextBackground = 2130903281;
public static final int editTextColor = 2130903282;
public static final int editTextStyle = 2130903283;
public static final int elevation = 2130903284;
public static final int elevationOverlayColor = 2130903285;
public static final int elevationOverlayEnabled = 2130903286;
public static final int emptyVisibility = 2130903287;
public static final int endIconCheckable = 2130903288;
public static final int endIconContentDescription = 2130903289;
public static final int endIconDrawable = 2130903290;
public static final int endIconMode = 2130903291;
public static final int endIconTint = 2130903292;
public static final int endIconTintMode = 2130903293;
public static final int enforceMaterialTheme = 2130903294;
public static final int enforceTextAppearance = 2130903295;
public static final int ensureMinTouchTargetSize = 2130903296;
public static final int errorEnabled = 2130903297;
public static final int errorIconDrawable = 2130903298;
public static final int errorIconTint = 2130903299;
public static final int errorIconTintMode = 2130903300;
public static final int errorTextAppearance = 2130903301;
public static final int errorTextColor = 2130903302;
public static final int expandActivityOverflowButtonDrawable = 2130903303;
public static final int expanded = 2130903304;
public static final int expandedTitleGravity = 2130903305;
public static final int expandedTitleMargin = 2130903306;
public static final int expandedTitleMarginBottom = 2130903307;
public static final int expandedTitleMarginEnd = 2130903308;
public static final int expandedTitleMarginStart = 2130903309;
public static final int expandedTitleMarginTop = 2130903310;
public static final int expandedTitleTextAppearance = 2130903311;
public static final int extendMotionSpec = 2130903312;
public static final int extendedFloatingActionButtonStyle = 2130903313;
public static final int fabAlignmentMode = 2130903314;
public static final int fabAnimationMode = 2130903315;
public static final int fabCradleMargin = 2130903316;
public static final int fabCradleRoundedCornerRadius = 2130903317;
public static final int fabCradleVerticalOffset = 2130903318;
public static final int fabCustomSize = 2130903319;
public static final int fabSize = 2130903320;
public static final int fastScrollEnabled = 2130903321;
public static final int fastScrollHorizontalThumbDrawable = 2130903322;
public static final int fastScrollHorizontalTrackDrawable = 2130903323;
public static final int fastScrollVerticalThumbDrawable = 2130903324;
public static final int fastScrollVerticalTrackDrawable = 2130903325;
public static final int firstBaselineToTopHeight = 2130903326;
public static final int floatingActionButtonStyle = 2130903327;
public static final int font = 2130903328;
public static final int fontFamily = 2130903329;
public static final int fontProviderAuthority = 2130903330;
public static final int fontProviderCerts = 2130903331;
public static final int fontProviderFetchStrategy = 2130903332;
public static final int fontProviderFetchTimeout = 2130903333;
public static final int fontProviderPackage = 2130903334;
public static final int fontProviderQuery = 2130903335;
public static final int fontStyle = 2130903336;
public static final int fontVariationSettings = 2130903337;
public static final int fontWeight = 2130903338;
public static final int foregroundInsidePadding = 2130903339;
public static final int gapBetweenBars = 2130903340;
public static final int goIcon = 2130903341;
public static final int headerLayout = 2130903342;
public static final int height = 2130903343;
public static final int helperText = 2130903344;
public static final int helperTextEnabled = 2130903345;
public static final int helperTextTextAppearance = 2130903346;
public static final int helperTextTextColor = 2130903347;
public static final int hideMotionSpec = 2130903348;
public static final int hideOnContentScroll = 2130903349;
public static final int hideOnScroll = 2130903350;
public static final int hintAnimationEnabled = 2130903351;
public static final int hintEnabled = 2130903352;
public static final int hintTextAppearance = 2130903353;
public static final int hintTextColor = 2130903354;
public static final int homeAsUpIndicator = 2130903355;
public static final int homeLayout = 2130903356;
public static final int hoveredFocusedTranslationZ = 2130903357;
public static final int icon = 2130903358;
public static final int iconEndPadding = 2130903359;
public static final int iconGravity = 2130903360;
public static final int iconPadding = 2130903361;
public static final int iconSize = 2130903362;
public static final int iconStartPadding = 2130903363;
public static final int iconTint = 2130903364;
public static final int iconTintMode = 2130903365;
public static final int iconifiedByDefault = 2130903366;
public static final int imageButtonStyle = 2130903367;
public static final int indeterminateProgressStyle = 2130903368;
public static final int initialActivityCount = 2130903369;
public static final int insetForeground = 2130903370;
public static final int isLightTheme = 2130903371;
public static final int isMaterialTheme = 2130903372;
public static final int itemBackground = 2130903373;
public static final int itemFillColor = 2130903374;
public static final int itemHorizontalPadding = 2130903375;
public static final int itemHorizontalTranslationEnabled = 2130903376;
public static final int itemIconPadding = 2130903377;
public static final int itemIconSize = 2130903378;
public static final int itemIconTint = 2130903379;
public static final int itemMaxLines = 2130903380;
public static final int itemPadding = 2130903381;
public static final int itemRippleColor = 2130903382;
public static final int itemShapeAppearance = 2130903383;
public static final int itemShapeAppearanceOverlay = 2130903384;
public static final int itemShapeFillColor = 2130903385;
public static final int itemShapeInsetBottom = 2130903386;
public static final int itemShapeInsetEnd = 2130903387;
public static final int itemShapeInsetStart = 2130903388;
public static final int itemShapeInsetTop = 2130903389;
public static final int itemSpacing = 2130903390;
public static final int itemStrokeColor = 2130903391;
public static final int itemStrokeWidth = 2130903392;
public static final int itemTextAppearance = 2130903393;
public static final int itemTextAppearanceActive = 2130903394;
public static final int itemTextAppearanceInactive = 2130903395;
public static final int itemTextColor = 2130903396;
public static final int keylines = 2130903397;
public static final int labelVisibilityMode = 2130903398;
public static final int lastBaselineToBottomHeight = 2130903399;
public static final int layout = 2130903400;
public static final int layoutManager = 2130903401;
public static final int layout_anchor = 2130903402;
public static final int layout_anchorGravity = 2130903403;
public static final int layout_behavior = 2130903404;
public static final int layout_collapseMode = 2130903405;
public static final int layout_collapseParallaxMultiplier = 2130903406;
public static final int layout_constrainedHeight = 2130903407;
public static final int layout_constrainedWidth = 2130903408;
public static final int layout_constraintBaseline_creator = 2130903409;
public static final int layout_constraintBaseline_toBaselineOf = 2130903410;
public static final int layout_constraintBottom_creator = 2130903411;
public static final int layout_constraintBottom_toBottomOf = 2130903412;
public static final int layout_constraintBottom_toTopOf = 2130903413;
public static final int layout_constraintCircle = 2130903414;
public static final int layout_constraintCircleAngle = 2130903415;
public static final int layout_constraintCircleRadius = 2130903416;
public static final int layout_constraintDimensionRatio = 2130903417;
public static final int layout_constraintEnd_toEndOf = 2130903418;
public static final int layout_constraintEnd_toStartOf = 2130903419;
public static final int layout_constraintGuide_begin = 2130903420;
public static final int layout_constraintGuide_end = 2130903421;
public static final int layout_constraintGuide_percent = 2130903422;
public static final int layout_constraintHeight_default = 2130903423;
public static final int layout_constraintHeight_max = 2130903424;
public static final int layout_constraintHeight_min = 2130903425;
public static final int layout_constraintHeight_percent = 2130903426;
public static final int layout_constraintHorizontal_bias = 2130903427;
public static final int layout_constraintHorizontal_chainStyle = 2130903428;
public static final int layout_constraintHorizontal_weight = 2130903429;
public static final int layout_constraintLeft_creator = 2130903430;
public static final int layout_constraintLeft_toLeftOf = 2130903431;
public static final int layout_constraintLeft_toRightOf = 2130903432;
public static final int layout_constraintRight_creator = 2130903433;
public static final int layout_constraintRight_toLeftOf = 2130903434;
public static final int layout_constraintRight_toRightOf = 2130903435;
public static final int layout_constraintStart_toEndOf = 2130903436;
public static final int layout_constraintStart_toStartOf = 2130903437;
public static final int layout_constraintTop_creator = 2130903438;
public static final int layout_constraintTop_toBottomOf = 2130903439;
public static final int layout_constraintTop_toTopOf = 2130903440;
public static final int layout_constraintVertical_bias = 2130903441;
public static final int layout_constraintVertical_chainStyle = 2130903442;
public static final int layout_constraintVertical_weight = 2130903443;
public static final int layout_constraintWidth_default = 2130903444;
public static final int layout_constraintWidth_max = 2130903445;
public static final int layout_constraintWidth_min = 2130903446;
public static final int layout_constraintWidth_percent = 2130903447;
public static final int layout_dodgeInsetEdges = 2130903448;
public static final int layout_editor_absoluteX = 2130903449;
public static final int layout_editor_absoluteY = 2130903450;
public static final int layout_goneMarginBottom = 2130903451;
public static final int layout_goneMarginEnd = 2130903452;
public static final int layout_goneMarginLeft = 2130903453;
public static final int layout_goneMarginRight = 2130903454;
public static final int layout_goneMarginStart = 2130903455;
public static final int layout_goneMarginTop = 2130903456;
public static final int layout_insetEdge = 2130903457;
public static final int layout_keyline = 2130903458;
public static final int layout_optimizationLevel = 2130903459;
public static final int layout_scrollFlags = 2130903460;
public static final int layout_scrollInterpolator = 2130903461;
public static final int liftOnScroll = 2130903462;
public static final int liftOnScrollTargetViewId = 2130903463;
public static final int lineHeight = 2130903464;
public static final int lineSpacing = 2130903465;
public static final int listChoiceBackgroundIndicator = 2130903466;
public static final int listChoiceIndicatorMultipleAnimated = 2130903467;
public static final int listChoiceIndicatorSingleAnimated = 2130903468;
public static final int listDividerAlertDialog = 2130903469;
public static final int listItemLayout = 2130903470;
public static final int listLayout = 2130903471;
public static final int listMenuViewStyle = 2130903472;
public static final int listPopupWindowStyle = 2130903473;
public static final int listPreferredItemHeight = 2130903474;
public static final int listPreferredItemHeightLarge = 2130903475;
public static final int listPreferredItemHeightSmall = 2130903476;
public static final int listPreferredItemPaddingEnd = 2130903477;
public static final int listPreferredItemPaddingLeft = 2130903478;
public static final int listPreferredItemPaddingRight = 2130903479;
public static final int listPreferredItemPaddingStart = 2130903480;
public static final int logo = 2130903481;
public static final int logoDescription = 2130903482;
public static final int materialAlertDialogBodyTextStyle = 2130903483;
public static final int materialAlertDialogTheme = 2130903484;
public static final int materialAlertDialogTitleIconStyle = 2130903485;
public static final int materialAlertDialogTitlePanelStyle = 2130903486;
public static final int materialAlertDialogTitleTextStyle = 2130903487;
public static final int materialButtonOutlinedStyle = 2130903488;
public static final int materialButtonStyle = 2130903489;
public static final int materialButtonToggleGroupStyle = 2130903490;
public static final int materialCalendarDay = 2130903491;
public static final int materialCalendarFullscreenTheme = 2130903492;
public static final int materialCalendarHeaderConfirmButton = 2130903493;
public static final int materialCalendarHeaderDivider = 2130903494;
public static final int materialCalendarHeaderLayout = 2130903495;
public static final int materialCalendarHeaderSelection = 2130903496;
public static final int materialCalendarHeaderTitle = 2130903497;
public static final int materialCalendarHeaderToggleButton = 2130903498;
public static final int materialCalendarStyle = 2130903499;
public static final int materialCalendarTheme = 2130903500;
public static final int materialCardViewStyle = 2130903501;
public static final int materialThemeOverlay = 2130903502;
public static final int maxActionInlineWidth = 2130903503;
public static final int maxButtonHeight = 2130903504;
public static final int maxCharacterCount = 2130903505;
public static final int maxImageSize = 2130903506;
public static final int measureWithLargestChild = 2130903507;
public static final int menu = 2130903508;
public static final int minTouchTargetSize = 2130903509;
public static final int multiChoiceItemLayout = 2130903510;
public static final int navigationContentDescription = 2130903511;
public static final int navigationIcon = 2130903512;
public static final int navigationMode = 2130903513;
public static final int navigationViewStyle = 2130903514;
public static final int number = 2130903515;
public static final int numericModifiers = 2130903516;
public static final int overlapAnchor = 2130903517;
public static final int paddingBottomNoButtons = 2130903518;
public static final int paddingEnd = 2130903519;
public static final int paddingStart = 2130903520;
public static final int paddingTopNoTitle = 2130903521;
public static final int panelBackground = 2130903522;
public static final int panelMenuListTheme = 2130903523;
public static final int panelMenuListWidth = 2130903524;
public static final int passwordToggleContentDescription = 2130903525;
public static final int passwordToggleDrawable = 2130903526;
public static final int passwordToggleEnabled = 2130903527;
public static final int passwordToggleTint = 2130903528;
public static final int passwordToggleTintMode = 2130903529;
public static final int popupMenuBackground = 2130903530;
public static final int popupMenuStyle = 2130903531;
public static final int popupTheme = 2130903532;
public static final int popupWindowStyle = 2130903533;
public static final int preserveIconSpacing = 2130903534;
public static final int pressedTranslationZ = 2130903535;
public static final int progressBarPadding = 2130903536;
public static final int progressBarStyle = 2130903537;
public static final int queryBackground = 2130903538;
public static final int queryHint = 2130903539;
public static final int radioButtonStyle = 2130903540;
public static final int rangeFillColor = 2130903541;
public static final int ratingBarStyle = 2130903542;
public static final int ratingBarStyleIndicator = 2130903543;
public static final int ratingBarStyleSmall = 2130903544;
public static final int recyclerViewStyle = 2130903545;
public static final int reverseLayout = 2130903546;
public static final int rippleColor = 2130903547;
public static final int scrimAnimationDuration = 2130903548;
public static final int scrimBackground = 2130903549;
public static final int scrimVisibleHeightTrigger = 2130903550;
public static final int searchHintIcon = 2130903551;
public static final int searchIcon = 2130903552;
public static final int searchViewStyle = 2130903553;
public static final int seekBarStyle = 2130903554;
public static final int selectableItemBackground = 2130903555;
public static final int selectableItemBackgroundBorderless = 2130903556;
public static final int shapeAppearance = 2130903557;
public static final int shapeAppearanceLargeComponent = 2130903558;
public static final int shapeAppearanceMediumComponent = 2130903559;
public static final int shapeAppearanceOverlay = 2130903560;
public static final int shapeAppearanceSmallComponent = 2130903561;
public static final int showAsAction = 2130903562;
public static final int showDividers = 2130903563;
public static final int showMotionSpec = 2130903564;
public static final int showText = 2130903565;
public static final int showTitle = 2130903566;
public static final int shrinkMotionSpec = 2130903567;
public static final int singleChoiceItemLayout = 2130903568;
public static final int singleLine = 2130903569;
public static final int singleSelection = 2130903570;
public static final int snackbarButtonStyle = 2130903571;
public static final int snackbarStyle = 2130903572;
public static final int spanCount = 2130903573;
public static final int spinBars = 2130903574;
public static final int spinnerDropDownItemStyle = 2130903575;
public static final int spinnerStyle = 2130903576;
public static final int splitTrack = 2130903577;
public static final int srcCompat = 2130903578;
public static final int stackFromEnd = 2130903579;
public static final int startIconCheckable = 2130903580;
public static final int startIconContentDescription = 2130903581;
public static final int startIconDrawable = 2130903582;
public static final int startIconTint = 2130903583;
public static final int startIconTintMode = 2130903584;
public static final int state_above_anchor = 2130903585;
public static final int state_collapsed = 2130903586;
public static final int state_collapsible = 2130903587;
public static final int state_dragged = 2130903588;
public static final int state_liftable = 2130903589;
public static final int state_lifted = 2130903590;
public static final int statusBarBackground = 2130903591;
public static final int statusBarForeground = 2130903592;
public static final int statusBarScrim = 2130903593;
public static final int strokeColor = 2130903594;
public static final int strokeWidth = 2130903595;
public static final int subMenuArrow = 2130903596;
public static final int submitBackground = 2130903597;
public static final int subtitle = 2130903598;
public static final int subtitleTextAppearance = 2130903599;
public static final int subtitleTextColor = 2130903600;
public static final int subtitleTextStyle = 2130903601;
public static final int suggestionRowLayout = 2130903602;
public static final int switchMinWidth = 2130903603;
public static final int switchPadding = 2130903604;
public static final int switchStyle = 2130903605;
public static final int switchTextAppearance = 2130903606;
public static final int tabBackground = 2130903607;
public static final int tabContentStart = 2130903608;
public static final int tabGravity = 2130903609;
public static final int tabIconTint = 2130903610;
public static final int tabIconTintMode = 2130903611;
public static final int tabIndicator = 2130903612;
public static final int tabIndicatorAnimationDuration = 2130903613;
public static final int tabIndicatorColor = 2130903614;
public static final int tabIndicatorFullWidth = 2130903615;
public static final int tabIndicatorGravity = 2130903616;
public static final int tabIndicatorHeight = 2130903617;
public static final int tabInlineLabel = 2130903618;
public static final int tabMaxWidth = 2130903619;
public static final int tabMinWidth = 2130903620;
public static final int tabMode = 2130903621;
public static final int tabPadding = 2130903622;
public static final int tabPaddingBottom = 2130903623;
public static final int tabPaddingEnd = 2130903624;
public static final int tabPaddingStart = 2130903625;
public static final int tabPaddingTop = 2130903626;
public static final int tabRippleColor = 2130903627;
public static final int tabSelectedTextColor = 2130903628;
public static final int tabStyle = 2130903629;
public static final int tabTextAppearance = 2130903630;
public static final int tabTextColor = 2130903631;
public static final int tabUnboundedRipple = 2130903632;
public static final int textAllCaps = 2130903633;
public static final int textAppearanceBody1 = 2130903634;
public static final int textAppearanceBody2 = 2130903635;
public static final int textAppearanceButton = 2130903636;
public static final int textAppearanceCaption = 2130903637;
public static final int textAppearanceHeadline1 = 2130903638;
public static final int textAppearanceHeadline2 = 2130903639;
public static final int textAppearanceHeadline3 = 2130903640;
public static final int textAppearanceHeadline4 = 2130903641;
public static final int textAppearanceHeadline5 = 2130903642;
public static final int textAppearanceHeadline6 = 2130903643;
public static final int textAppearanceLargePopupMenu = 2130903644;
public static final int textAppearanceLineHeightEnabled = 2130903645;
public static final int textAppearanceListItem = 2130903646;
public static final int textAppearanceListItemSecondary = 2130903647;
public static final int textAppearanceListItemSmall = 2130903648;
public static final int textAppearanceOverline = 2130903649;
public static final int textAppearancePopupMenuHeader = 2130903650;
public static final int textAppearanceSearchResultSubtitle = 2130903651;
public static final int textAppearanceSearchResultTitle = 2130903652;
public static final int textAppearanceSmallPopupMenu = 2130903653;
public static final int textAppearanceSubtitle1 = 2130903654;
public static final int textAppearanceSubtitle2 = 2130903655;
public static final int textColorAlertDialogListItem = 2130903656;
public static final int textColorSearchUrl = 2130903657;
public static final int textEndPadding = 2130903658;
public static final int textInputStyle = 2130903659;
public static final int textLocale = 2130903660;
public static final int textStartPadding = 2130903661;
public static final int theme = 2130903662;
public static final int themeLineHeight = 2130903663;
public static final int thickness = 2130903664;
public static final int thumbTextPadding = 2130903665;
public static final int thumbTint = 2130903666;
public static final int thumbTintMode = 2130903667;
public static final int tickMark = 2130903668;
public static final int tickMarkTint = 2130903669;
public static final int tickMarkTintMode = 2130903670;
public static final int tint = 2130903671;
public static final int tintMode = 2130903672;
public static final int title = 2130903673;
public static final int titleEnabled = 2130903674;
public static final int titleMargin = 2130903675;
public static final int titleMarginBottom = 2130903676;
public static final int titleMarginEnd = 2130903677;
public static final int titleMarginStart = 2130903678;
public static final int titleMarginTop = 2130903679;
public static final int titleMargins = 2130903680;
public static final int titleTextAppearance = 2130903681;
public static final int titleTextColor = 2130903682;
public static final int titleTextStyle = 2130903683;
public static final int toolbarId = 2130903684;
public static final int toolbarNavigationButtonStyle = 2130903685;
public static final int toolbarStyle = 2130903686;
public static final int tooltipForegroundColor = 2130903687;
public static final int tooltipFrameBackground = 2130903688;
public static final int tooltipText = 2130903689;
public static final int track = 2130903690;
public static final int trackTint = 2130903691;
public static final int trackTintMode = 2130903692;
public static final int ttcIndex = 2130903693;
public static final int useCompatPadding = 2130903694;
public static final int useMaterialThemeColors = 2130903695;
public static final int viewInflaterClass = 2130903696;
public static final int voiceIcon = 2130903697;
public static final int windowActionBar = 2130903698;
public static final int windowActionBarOverlay = 2130903699;
public static final int windowActionModeOverlay = 2130903700;
public static final int windowFixedHeightMajor = 2130903701;
public static final int windowFixedHeightMinor = 2130903702;
public static final int windowFixedWidthMajor = 2130903703;
public static final int windowFixedWidthMinor = 2130903704;
public static final int windowMinWidthMajor = 2130903705;
public static final int windowMinWidthMinor = 2130903706;
public static final int windowNoTitle = 2130903707;
public static final int yearSelectedStyle = 2130903708;
public static final int yearStyle = 2130903709;
public static final int yearTodayStyle = 2130903710;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 2130968576;
public static final int abc_allow_stacked_button_bar = 2130968577;
public static final int abc_config_actionMenuItemAllCaps = 2130968578;
public static final int mtrl_btn_textappearance_all_caps = 2130968579;
}
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark = 2131034112;
public static final int abc_background_cache_hint_selector_material_light = 2131034113;
public static final int abc_btn_colored_borderless_text_material = 2131034114;
public static final int abc_btn_colored_text_material = 2131034115;
public static final int abc_color_highlight_material = 2131034116;
public static final int abc_hint_foreground_material_dark = 2131034117;
public static final int abc_hint_foreground_material_light = 2131034118;
public static final int abc_input_method_navigation_guard = 2131034119;
public static final int abc_primary_text_disable_only_material_dark = 2131034120;
public static final int abc_primary_text_disable_only_material_light = 2131034121;
public static final int abc_primary_text_material_dark = 2131034122;
public static final int abc_primary_text_material_light = 2131034123;
public static final int abc_search_url_text = 2131034124;
public static final int abc_search_url_text_normal = 2131034125;
public static final int abc_search_url_text_pressed = 2131034126;
public static final int abc_search_url_text_selected = 2131034127;
public static final int abc_secondary_text_material_dark = 2131034128;
public static final int abc_secondary_text_material_light = 2131034129;
public static final int abc_tint_btn_checkable = 2131034130;
public static final int abc_tint_default = 2131034131;
public static final int abc_tint_edittext = 2131034132;
public static final int abc_tint_seek_thumb = 2131034133;
public static final int abc_tint_spinner = 2131034134;
public static final int abc_tint_switch_track = 2131034135;
public static final int accent_material_dark = 2131034136;
public static final int accent_material_light = 2131034137;
public static final int background_floating_material_dark = 2131034138;
public static final int background_floating_material_light = 2131034139;
public static final int background_material_dark = 2131034140;
public static final int background_material_light = 2131034141;
public static final int black = 2131034142;
public static final int bright_foreground_disabled_material_dark = 2131034143;
public static final int bright_foreground_disabled_material_light = 2131034144;
public static final int bright_foreground_inverse_material_dark = 2131034145;
public static final int bright_foreground_inverse_material_light = 2131034146;
public static final int bright_foreground_material_dark = 2131034147;
public static final int bright_foreground_material_light = 2131034148;
public static final int button_material_dark = 2131034149;
public static final int button_material_light = 2131034150;
public static final int cardview_dark_background = 2131034151;
public static final int cardview_light_background = 2131034152;
public static final int cardview_shadow_end_color = 2131034153;
public static final int cardview_shadow_start_color = 2131034154;
public static final int checkbox_themeable_attribute_color = 2131034155;
public static final int design_bottom_navigation_shadow_color = 2131034156;
public static final int design_box_stroke_color = 2131034157;
public static final int design_dark_default_color_background = 2131034158;
public static final int design_dark_default_color_error = 2131034159;
public static final int design_dark_default_color_on_background = 2131034160;
public static final int design_dark_default_color_on_error = 2131034161;
public static final int design_dark_default_color_on_primary = 2131034162;
public static final int design_dark_default_color_on_secondary = 2131034163;
public static final int design_dark_default_color_on_surface = 2131034164;
public static final int design_dark_default_color_primary = 2131034165;
public static final int design_dark_default_color_primary_dark = 2131034166;
public static final int design_dark_default_color_primary_variant = 2131034167;
public static final int design_dark_default_color_secondary = 2131034168;
public static final int design_dark_default_color_secondary_variant = 2131034169;
public static final int design_dark_default_color_surface = 2131034170;
public static final int design_default_color_background = 2131034171;
public static final int design_default_color_error = 2131034172;
public static final int design_default_color_on_background = 2131034173;
public static final int design_default_color_on_error = 2131034174;
public static final int design_default_color_on_primary = 2131034175;
public static final int design_default_color_on_secondary = 2131034176;
public static final int design_default_color_on_surface = 2131034177;
public static final int design_default_color_primary = 2131034178;
public static final int design_default_color_primary_dark = 2131034179;
public static final int design_default_color_primary_variant = 2131034180;
public static final int design_default_color_secondary = 2131034181;
public static final int design_default_color_secondary_variant = 2131034182;
public static final int design_default_color_surface = 2131034183;
public static final int design_error = 2131034184;
public static final int design_fab_shadow_end_color = 2131034185;
public static final int design_fab_shadow_mid_color = 2131034186;
public static final int design_fab_shadow_start_color = 2131034187;
public static final int design_fab_stroke_end_inner_color = 2131034188;
public static final int design_fab_stroke_end_outer_color = 2131034189;
public static final int design_fab_stroke_top_inner_color = 2131034190;
public static final int design_fab_stroke_top_outer_color = 2131034191;
public static final int design_icon_tint = 2131034192;
public static final int design_snackbar_background_color = 2131034193;
public static final int dim_foreground_disabled_material_dark = 2131034194;
public static final int dim_foreground_disabled_material_light = 2131034195;
public static final int dim_foreground_material_dark = 2131034196;
public static final int dim_foreground_material_light = 2131034197;
public static final int error_color_material_dark = 2131034198;
public static final int error_color_material_light = 2131034199;
public static final int foreground_material_dark = 2131034200;
public static final int foreground_material_light = 2131034201;
public static final int highlighted_text_material_dark = 2131034202;
public static final int highlighted_text_material_light = 2131034203;
public static final int material_blue_grey_800 = 2131034204;
public static final int material_blue_grey_900 = 2131034205;
public static final int material_blue_grey_950 = 2131034206;
public static final int material_deep_teal_200 = 2131034207;
public static final int material_deep_teal_500 = 2131034208;
public static final int material_grey_100 = 2131034209;
public static final int material_grey_300 = 2131034210;
public static final int material_grey_50 = 2131034211;
public static final int material_grey_600 = 2131034212;
public static final int material_grey_800 = 2131034213;
public static final int material_grey_850 = 2131034214;
public static final int material_grey_900 = 2131034215;
public static final int material_on_background_disabled = 2131034216;
public static final int material_on_background_emphasis_high_type = 2131034217;
public static final int material_on_background_emphasis_medium = 2131034218;
public static final int material_on_primary_disabled = 2131034219;
public static final int material_on_primary_emphasis_high_type = 2131034220;
public static final int material_on_primary_emphasis_medium = 2131034221;
public static final int material_on_surface_disabled = 2131034222;
public static final int material_on_surface_emphasis_high_type = 2131034223;
public static final int material_on_surface_emphasis_medium = 2131034224;
public static final int mtrl_bottom_nav_colored_item_tint = 2131034225;
public static final int mtrl_bottom_nav_colored_ripple_color = 2131034226;
public static final int mtrl_bottom_nav_item_tint = 2131034227;
public static final int mtrl_bottom_nav_ripple_color = 2131034228;
public static final int mtrl_btn_bg_color_selector = 2131034229;
public static final int mtrl_btn_ripple_color = 2131034230;
public static final int mtrl_btn_stroke_color_selector = 2131034231;
public static final int mtrl_btn_text_btn_bg_color_selector = 2131034232;
public static final int mtrl_btn_text_btn_ripple_color = 2131034233;
public static final int mtrl_btn_text_color_disabled = 2131034234;
public static final int mtrl_btn_text_color_selector = 2131034235;
public static final int mtrl_btn_transparent_bg_color = 2131034236;
public static final int mtrl_calendar_item_stroke_color = 2131034237;
public static final int mtrl_calendar_selected_range = 2131034238;
public static final int mtrl_card_view_foreground = 2131034239;
public static final int mtrl_card_view_ripple = 2131034240;
public static final int mtrl_chip_background_color = 2131034241;
public static final int mtrl_chip_close_icon_tint = 2131034242;
public static final int mtrl_chip_ripple_color = 2131034243;
public static final int mtrl_chip_surface_color = 2131034244;
public static final int mtrl_chip_text_color = 2131034245;
public static final int mtrl_choice_chip_background_color = 2131034246;
public static final int mtrl_choice_chip_ripple_color = 2131034247;
public static final int mtrl_choice_chip_text_color = 2131034248;
public static final int mtrl_error = 2131034249;
public static final int mtrl_extended_fab_bg_color_selector = 2131034250;
public static final int mtrl_extended_fab_ripple_color = 2131034251;
public static final int mtrl_extended_fab_text_color_selector = 2131034252;
public static final int mtrl_fab_ripple_color = 2131034253;
public static final int mtrl_filled_background_color = 2131034254;
public static final int mtrl_filled_icon_tint = 2131034255;
public static final int mtrl_filled_stroke_color = 2131034256;
public static final int mtrl_indicator_text_color = 2131034257;
public static final int mtrl_navigation_item_background_color = 2131034258;
public static final int mtrl_navigation_item_icon_tint = 2131034259;
public static final int mtrl_navigation_item_text_color = 2131034260;
public static final int mtrl_on_primary_text_btn_text_color_selector = 2131034261;
public static final int mtrl_outlined_icon_tint = 2131034262;
public static final int mtrl_outlined_stroke_color = 2131034263;
public static final int mtrl_popupmenu_overlay_color = 2131034264;
public static final int mtrl_scrim_color = 2131034265;
public static final int mtrl_tabs_colored_ripple_color = 2131034266;
public static final int mtrl_tabs_icon_color_selector = 2131034267;
public static final int mtrl_tabs_icon_color_selector_colored = 2131034268;
public static final int mtrl_tabs_legacy_text_color_selector = 2131034269;
public static final int mtrl_tabs_ripple_color = 2131034270;
public static final int mtrl_text_btn_text_color_selector = 2131034271;
public static final int mtrl_textinput_default_box_stroke_color = 2131034272;
public static final int mtrl_textinput_disabled_color = 2131034273;
public static final int mtrl_textinput_filled_box_default_background_color = 2131034274;
public static final int mtrl_textinput_focused_box_stroke_color = 2131034275;
public static final int mtrl_textinput_hovered_box_stroke_color = 2131034276;
public static final int notification_action_color_filter = 2131034277;
public static final int notification_icon_bg_color = 2131034278;
public static final int primary_dark_material_dark = 2131034279;
public static final int primary_dark_material_light = 2131034280;
public static final int primary_material_dark = 2131034281;
public static final int primary_material_light = 2131034282;
public static final int primary_text_default_material_dark = 2131034283;
public static final int primary_text_default_material_light = 2131034284;
public static final int primary_text_disabled_material_dark = 2131034285;
public static final int primary_text_disabled_material_light = 2131034286;
public static final int purple_200 = 2131034287;
public static final int purple_500 = 2131034288;
public static final int purple_700 = 2131034289;
public static final int ripple_material_dark = 2131034290;
public static final int ripple_material_light = 2131034291;
public static final int secondary_text_default_material_dark = 2131034292;
public static final int secondary_text_default_material_light = 2131034293;
public static final int secondary_text_disabled_material_dark = 2131034294;
public static final int secondary_text_disabled_material_light = 2131034295;
public static final int switch_thumb_disabled_material_dark = 2131034296;
public static final int switch_thumb_disabled_material_light = 2131034297;
public static final int switch_thumb_material_dark = 2131034298;
public static final int switch_thumb_material_light = 2131034299;
public static final int switch_thumb_normal_material_dark = 2131034300;
public static final int switch_thumb_normal_material_light = 2131034301;
public static final int teal_200 = 2131034302;
public static final int teal_700 = 2131034303;
public static final int test_mtrl_calendar_day = 2131034304;
public static final int test_mtrl_calendar_day_selected = 2131034305;
public static final int tooltip_background_dark = 2131034306;
public static final int tooltip_background_light = 2131034307;
public static final int white = 2131034308;
}
public static final class dimen {
public static final int abc_action_bar_content_inset_material = 2131099648;
public static final int abc_action_bar_content_inset_with_nav = 2131099649;
public static final int abc_action_bar_default_height_material = 2131099650;
public static final int abc_action_bar_default_padding_end_material = 2131099651;
public static final int abc_action_bar_default_padding_start_material = 2131099652;
public static final int abc_action_bar_elevation_material = 2131099653;
public static final int abc_action_bar_icon_vertical_padding_material = 2131099654;
public static final int abc_action_bar_overflow_padding_end_material = 2131099655;
public static final int abc_action_bar_overflow_padding_start_material = 2131099656;
public static final int abc_action_bar_stacked_max_height = 2131099657;
public static final int abc_action_bar_stacked_tab_max_width = 2131099658;
public static final int abc_action_bar_subtitle_bottom_margin_material = 2131099659;
public static final int abc_action_bar_subtitle_top_margin_material = 2131099660;
public static final int abc_action_button_min_height_material = 2131099661;
public static final int abc_action_button_min_width_material = 2131099662;
public static final int abc_action_button_min_width_overflow_material = 2131099663;
public static final int abc_alert_dialog_button_bar_height = 2131099664;
public static final int abc_alert_dialog_button_dimen = 2131099665;
public static final int abc_button_inset_horizontal_material = 2131099666;
public static final int abc_button_inset_vertical_material = 2131099667;
public static final int abc_button_padding_horizontal_material = 2131099668;
public static final int abc_button_padding_vertical_material = 2131099669;
public static final int abc_cascading_menus_min_smallest_width = 2131099670;
public static final int abc_config_prefDialogWidth = 2131099671;
public static final int abc_control_corner_material = 2131099672;
public static final int abc_control_inset_material = 2131099673;
public static final int abc_control_padding_material = 2131099674;
public static final int abc_dialog_corner_radius_material = 2131099675;
public static final int abc_dialog_fixed_height_major = 2131099676;
public static final int abc_dialog_fixed_height_minor = 2131099677;
public static final int abc_dialog_fixed_width_major = 2131099678;
public static final int abc_dialog_fixed_width_minor = 2131099679;
public static final int abc_dialog_list_padding_bottom_no_buttons = 2131099680;
public static final int abc_dialog_list_padding_top_no_title = 2131099681;
public static final int abc_dialog_min_width_major = 2131099682;
public static final int abc_dialog_min_width_minor = 2131099683;
public static final int abc_dialog_padding_material = 2131099684;
public static final int abc_dialog_padding_top_material = 2131099685;
public static final int abc_dialog_title_divider_material = 2131099686;
public static final int abc_disabled_alpha_material_dark = 2131099687;
public static final int abc_disabled_alpha_material_light = 2131099688;
public static final int abc_dropdownitem_icon_width = 2131099689;
public static final int abc_dropdownitem_text_padding_left = 2131099690;
public static final int abc_dropdownitem_text_padding_right = 2131099691;
public static final int abc_edit_text_inset_bottom_material = 2131099692;
public static final int abc_edit_text_inset_horizontal_material = 2131099693;
public static final int abc_edit_text_inset_top_material = 2131099694;
public static final int abc_floating_window_z = 2131099695;
public static final int abc_list_item_height_large_material = 2131099696;
public static final int abc_list_item_height_material = 2131099697;
public static final int abc_list_item_height_small_material = 2131099698;
public static final int abc_list_item_padding_horizontal_material = 2131099699;
public static final int abc_panel_menu_list_width = 2131099700;
public static final int abc_progress_bar_height_material = 2131099701;
public static final int abc_search_view_preferred_height = 2131099702;
public static final int abc_search_view_preferred_width = 2131099703;
public static final int abc_seekbar_track_background_height_material = 2131099704;
public static final int abc_seekbar_track_progress_height_material = 2131099705;
public static final int abc_select_dialog_padding_start_material = 2131099706;
public static final int abc_switch_padding = 2131099707;
public static final int abc_text_size_body_1_material = 2131099708;
public static final int abc_text_size_body_2_material = 2131099709;
public static final int abc_text_size_button_material = 2131099710;
public static final int abc_text_size_caption_material = 2131099711;
public static final int abc_text_size_display_1_material = 2131099712;
public static final int abc_text_size_display_2_material = 2131099713;
public static final int abc_text_size_display_3_material = 2131099714;
public static final int abc_text_size_display_4_material = 2131099715;
public static final int abc_text_size_headline_material = 2131099716;
public static final int abc_text_size_large_material = 2131099717;
public static final int abc_text_size_medium_material = 2131099718;
public static final int abc_text_size_menu_header_material = 2131099719;
public static final int abc_text_size_menu_material = 2131099720;
public static final int abc_text_size_small_material = 2131099721;
public static final int abc_text_size_subhead_material = 2131099722;
public static final int abc_text_size_subtitle_material_toolbar = 2131099723;
public static final int abc_text_size_title_material = 2131099724;
public static final int abc_text_size_title_material_toolbar = 2131099725;
public static final int action_bar_size = 2131099726;
public static final int appcompat_dialog_background_inset = 2131099727;
public static final int cardview_compat_inset_shadow = 2131099728;
public static final int cardview_default_elevation = 2131099729;
public static final int cardview_default_radius = 2131099730;
public static final int compat_button_inset_horizontal_material = 2131099731;
public static final int compat_button_inset_vertical_material = 2131099732;
public static final int compat_button_padding_horizontal_material = 2131099733;
public static final int compat_button_padding_vertical_material = 2131099734;
public static final int compat_control_corner_material = 2131099735;
public static final int compat_notification_large_icon_max_height = 2131099736;
public static final int compat_notification_large_icon_max_width = 2131099737;
public static final int default_dimension = 2131099738;
public static final int design_appbar_elevation = 2131099739;
public static final int design_bottom_navigation_active_item_max_width = 2131099740;
public static final int design_bottom_navigation_active_item_min_width = 2131099741;
public static final int design_bottom_navigation_active_text_size = 2131099742;
public static final int design_bottom_navigation_elevation = 2131099743;
public static final int design_bottom_navigation_height = 2131099744;
public static final int design_bottom_navigation_icon_size = 2131099745;
public static final int design_bottom_navigation_item_max_width = 2131099746;
public static final int design_bottom_navigation_item_min_width = 2131099747;
public static final int design_bottom_navigation_margin = 2131099748;
public static final int design_bottom_navigation_shadow_height = 2131099749;
public static final int design_bottom_navigation_text_size = 2131099750;
public static final int design_bottom_sheet_elevation = 2131099751;
public static final int design_bottom_sheet_modal_elevation = 2131099752;
public static final int design_bottom_sheet_peek_height_min = 2131099753;
public static final int design_fab_border_width = 2131099754;
public static final int design_fab_elevation = 2131099755;
public static final int design_fab_image_size = 2131099756;
public static final int design_fab_size_mini = 2131099757;
public static final int design_fab_size_normal = 2131099758;
public static final int design_fab_translation_z_hovered_focused = 2131099759;
public static final int design_fab_translation_z_pressed = 2131099760;
public static final int design_navigation_elevation = 2131099761;
public static final int design_navigation_icon_padding = 2131099762;
public static final int design_navigation_icon_size = 2131099763;
public static final int design_navigation_item_horizontal_padding = 2131099764;
public static final int design_navigation_item_icon_padding = 2131099765;
public static final int design_navigation_max_width = 2131099766;
public static final int design_navigation_padding_bottom = 2131099767;
public static final int design_navigation_separator_vertical_padding = 2131099768;
public static final int design_snackbar_action_inline_max_width = 2131099769;
public static final int design_snackbar_action_text_color_alpha = 2131099770;
public static final int design_snackbar_background_corner_radius = 2131099771;
public static final int design_snackbar_elevation = 2131099772;
public static final int design_snackbar_extra_spacing_horizontal = 2131099773;
public static final int design_snackbar_max_width = 2131099774;
public static final int design_snackbar_min_width = 2131099775;
public static final int design_snackbar_padding_horizontal = 2131099776;
public static final int design_snackbar_padding_vertical = 2131099777;
public static final int design_snackbar_padding_vertical_2lines = 2131099778;
public static final int design_snackbar_text_size = 2131099779;
public static final int design_tab_max_width = 2131099780;
public static final int design_tab_scrollable_min_width = 2131099781;
public static final int design_tab_text_size = 2131099782;
public static final int design_tab_text_size_2line = 2131099783;
public static final int design_textinput_caption_translate_y = 2131099784;
public static final int disabled_alpha_material_dark = 2131099785;
public static final int disabled_alpha_material_light = 2131099786;
public static final int fastscroll_default_thickness = 2131099787;
public static final int fastscroll_margin = 2131099788;
public static final int fastscroll_minimum_range = 2131099789;
public static final int highlight_alpha_material_colored = 2131099790;
public static final int highlight_alpha_material_dark = 2131099791;
public static final int highlight_alpha_material_light = 2131099792;
public static final int hint_alpha_material_dark = 2131099793;
public static final int hint_alpha_material_light = 2131099794;
public static final int hint_pressed_alpha_material_dark = 2131099795;
public static final int hint_pressed_alpha_material_light = 2131099796;
public static final int item_touch_helper_max_drag_scroll_per_frame = 2131099797;
public static final int item_touch_helper_swipe_escape_max_velocity = 2131099798;
public static final int item_touch_helper_swipe_escape_velocity = 2131099799;
public static final int material_emphasis_disabled = 2131099800;
public static final int material_emphasis_high_type = 2131099801;
public static final int material_emphasis_medium = 2131099802;
public static final int material_text_view_test_line_height = 2131099803;
public static final int material_text_view_test_line_height_override = 2131099804;
public static final int mtrl_alert_dialog_background_inset_bottom = 2131099805;
public static final int mtrl_alert_dialog_background_inset_end = 2131099806;
public static final int mtrl_alert_dialog_background_inset_start = 2131099807;
public static final int mtrl_alert_dialog_background_inset_top = 2131099808;
public static final int mtrl_alert_dialog_picker_background_inset = 2131099809;
public static final int mtrl_badge_horizontal_edge_offset = 2131099810;
public static final int mtrl_badge_long_text_horizontal_padding = 2131099811;
public static final int mtrl_badge_radius = 2131099812;
public static final int mtrl_badge_text_horizontal_edge_offset = 2131099813;
public static final int mtrl_badge_text_size = 2131099814;
public static final int mtrl_badge_with_text_radius = 2131099815;
public static final int mtrl_bottomappbar_fabOffsetEndMode = 2131099816;
public static final int mtrl_bottomappbar_fab_bottom_margin = 2131099817;
public static final int mtrl_bottomappbar_fab_cradle_margin = 2131099818;
public static final int mtrl_bottomappbar_fab_cradle_rounded_corner_radius = 2131099819;
public static final int mtrl_bottomappbar_fab_cradle_vertical_offset = 2131099820;
public static final int mtrl_bottomappbar_height = 2131099821;
public static final int mtrl_btn_corner_radius = 2131099822;
public static final int mtrl_btn_dialog_btn_min_width = 2131099823;
public static final int mtrl_btn_disabled_elevation = 2131099824;
public static final int mtrl_btn_disabled_z = 2131099825;
public static final int mtrl_btn_elevation = 2131099826;
public static final int mtrl_btn_focused_z = 2131099827;
public static final int mtrl_btn_hovered_z = 2131099828;
public static final int mtrl_btn_icon_btn_padding_left = 2131099829;
public static final int mtrl_btn_icon_padding = 2131099830;
public static final int mtrl_btn_inset = 2131099831;
public static final int mtrl_btn_letter_spacing = 2131099832;
public static final int mtrl_btn_padding_bottom = 2131099833;
public static final int mtrl_btn_padding_left = 2131099834;
public static final int mtrl_btn_padding_right = 2131099835;
public static final int mtrl_btn_padding_top = 2131099836;
public static final int mtrl_btn_pressed_z = 2131099837;
public static final int mtrl_btn_stroke_size = 2131099838;
public static final int mtrl_btn_text_btn_icon_padding = 2131099839;
public static final int mtrl_btn_text_btn_padding_left = 2131099840;
public static final int mtrl_btn_text_btn_padding_right = 2131099841;
public static final int mtrl_btn_text_size = 2131099842;
public static final int mtrl_btn_z = 2131099843;
public static final int mtrl_calendar_action_height = 2131099844;
public static final int mtrl_calendar_action_padding = 2131099845;
public static final int mtrl_calendar_bottom_padding = 2131099846;
public static final int mtrl_calendar_content_padding = 2131099847;
public static final int mtrl_calendar_day_corner = 2131099848;
public static final int mtrl_calendar_day_height = 2131099849;
public static final int mtrl_calendar_day_horizontal_padding = 2131099850;
public static final int mtrl_calendar_day_today_stroke = 2131099851;
public static final int mtrl_calendar_day_vertical_padding = 2131099852;
public static final int mtrl_calendar_day_width = 2131099853;
public static final int mtrl_calendar_days_of_week_height = 2131099854;
public static final int mtrl_calendar_dialog_background_inset = 2131099855;
public static final int mtrl_calendar_header_content_padding = 2131099856;
public static final int mtrl_calendar_header_content_padding_fullscreen = 2131099857;
public static final int mtrl_calendar_header_divider_thickness = 2131099858;
public static final int mtrl_calendar_header_height = 2131099859;
public static final int mtrl_calendar_header_height_fullscreen = 2131099860;
public static final int mtrl_calendar_header_selection_line_height = 2131099861;
public static final int mtrl_calendar_header_text_padding = 2131099862;
public static final int mtrl_calendar_header_toggle_margin_bottom = 2131099863;
public static final int mtrl_calendar_header_toggle_margin_top = 2131099864;
public static final int mtrl_calendar_landscape_header_width = 2131099865;
public static final int mtrl_calendar_maximum_default_fullscreen_minor_axis = 2131099866;
public static final int mtrl_calendar_month_horizontal_padding = 2131099867;
public static final int mtrl_calendar_month_vertical_padding = 2131099868;
public static final int mtrl_calendar_navigation_bottom_padding = 2131099869;
public static final int mtrl_calendar_navigation_height = 2131099870;
public static final int mtrl_calendar_navigation_top_padding = 2131099871;
public static final int mtrl_calendar_pre_l_text_clip_padding = 2131099872;
public static final int mtrl_calendar_selection_baseline_to_top_fullscreen = 2131099873;
public static final int mtrl_calendar_selection_text_baseline_to_bottom = 2131099874;
public static final int mtrl_calendar_selection_text_baseline_to_bottom_fullscreen = 2131099875;
public static final int mtrl_calendar_selection_text_baseline_to_top = 2131099876;
public static final int mtrl_calendar_text_input_padding_top = 2131099877;
public static final int mtrl_calendar_title_baseline_to_top = 2131099878;
public static final int mtrl_calendar_title_baseline_to_top_fullscreen = 2131099879;
public static final int mtrl_calendar_year_corner = 2131099880;
public static final int mtrl_calendar_year_height = 2131099881;
public static final int mtrl_calendar_year_horizontal_padding = 2131099882;
public static final int mtrl_calendar_year_vertical_padding = 2131099883;
public static final int mtrl_calendar_year_width = 2131099884;
public static final int mtrl_card_checked_icon_margin = 2131099885;
public static final int mtrl_card_checked_icon_size = 2131099886;
public static final int mtrl_card_corner_radius = 2131099887;
public static final int mtrl_card_dragged_z = 2131099888;
public static final int mtrl_card_elevation = 2131099889;
public static final int mtrl_card_spacing = 2131099890;
public static final int mtrl_chip_pressed_translation_z = 2131099891;
public static final int mtrl_chip_text_size = 2131099892;
public static final int mtrl_exposed_dropdown_menu_popup_elevation = 2131099893;
public static final int mtrl_exposed_dropdown_menu_popup_vertical_offset = 2131099894;
public static final int mtrl_exposed_dropdown_menu_popup_vertical_padding = 2131099895;
public static final int mtrl_extended_fab_bottom_padding = 2131099896;
public static final int mtrl_extended_fab_corner_radius = 2131099897;
public static final int mtrl_extended_fab_disabled_elevation = 2131099898;
public static final int mtrl_extended_fab_disabled_translation_z = 2131099899;
public static final int mtrl_extended_fab_elevation = 2131099900;
public static final int mtrl_extended_fab_end_padding = 2131099901;
public static final int mtrl_extended_fab_end_padding_icon = 2131099902;
public static final int mtrl_extended_fab_icon_size = 2131099903;
public static final int mtrl_extended_fab_icon_text_spacing = 2131099904;
public static final int mtrl_extended_fab_min_height = 2131099905;
public static final int mtrl_extended_fab_min_width = 2131099906;
public static final int mtrl_extended_fab_start_padding = 2131099907;
public static final int mtrl_extended_fab_start_padding_icon = 2131099908;
public static final int mtrl_extended_fab_top_padding = 2131099909;
public static final int mtrl_extended_fab_translation_z_base = 2131099910;
public static final int mtrl_extended_fab_translation_z_hovered_focused = 2131099911;
public static final int mtrl_extended_fab_translation_z_pressed = 2131099912;
public static final int mtrl_fab_elevation = 2131099913;
public static final int mtrl_fab_min_touch_target = 2131099914;
public static final int mtrl_fab_translation_z_hovered_focused = 2131099915;
public static final int mtrl_fab_translation_z_pressed = 2131099916;
public static final int mtrl_high_ripple_default_alpha = 2131099917;
public static final int mtrl_high_ripple_focused_alpha = 2131099918;
public static final int mtrl_high_ripple_hovered_alpha = 2131099919;
public static final int mtrl_high_ripple_pressed_alpha = 2131099920;
public static final int mtrl_large_touch_target = 2131099921;
public static final int mtrl_low_ripple_default_alpha = 2131099922;
public static final int mtrl_low_ripple_focused_alpha = 2131099923;
public static final int mtrl_low_ripple_hovered_alpha = 2131099924;
public static final int mtrl_low_ripple_pressed_alpha = 2131099925;
public static final int mtrl_min_touch_target_size = 2131099926;
public static final int mtrl_navigation_elevation = 2131099927;
public static final int mtrl_navigation_item_horizontal_padding = 2131099928;
public static final int mtrl_navigation_item_icon_padding = 2131099929;
public static final int mtrl_navigation_item_icon_size = 2131099930;
public static final int mtrl_navigation_item_shape_horizontal_margin = 2131099931;
public static final int mtrl_navigation_item_shape_vertical_margin = 2131099932;
public static final int mtrl_shape_corner_size_large_component = 2131099933;
public static final int mtrl_shape_corner_size_medium_component = 2131099934;
public static final int mtrl_shape_corner_size_small_component = 2131099935;
public static final int mtrl_snackbar_action_text_color_alpha = 2131099936;
public static final int mtrl_snackbar_background_corner_radius = 2131099937;
public static final int mtrl_snackbar_background_overlay_color_alpha = 2131099938;
public static final int mtrl_snackbar_margin = 2131099939;
public static final int mtrl_switch_thumb_elevation = 2131099940;
public static final int mtrl_textinput_box_corner_radius_medium = 2131099941;
public static final int mtrl_textinput_box_corner_radius_small = 2131099942;
public static final int mtrl_textinput_box_label_cutout_padding = 2131099943;
public static final int mtrl_textinput_box_stroke_width_default = 2131099944;
public static final int mtrl_textinput_box_stroke_width_focused = 2131099945;
public static final int mtrl_textinput_end_icon_margin_start = 2131099946;
public static final int mtrl_textinput_outline_box_expanded_padding = 2131099947;
public static final int mtrl_textinput_start_icon_margin_end = 2131099948;
public static final int mtrl_toolbar_default_height = 2131099949;
public static final int notification_action_icon_size = 2131099950;
public static final int notification_action_text_size = 2131099951;
public static final int notification_big_circle_margin = 2131099952;
public static final int notification_content_margin_start = 2131099953;
public static final int notification_large_icon_height = 2131099954;
public static final int notification_large_icon_width = 2131099955;
public static final int notification_main_column_padding_top = 2131099956;
public static final int notification_media_narrow_margin = 2131099957;
public static final int notification_right_icon_size = 2131099958;
public static final int notification_right_side_padding_top = 2131099959;
public static final int notification_small_icon_background_padding = 2131099960;
public static final int notification_small_icon_size_as_large = 2131099961;
public static final int notification_subtext_size = 2131099962;
public static final int notification_top_pad = 2131099963;
public static final int notification_top_pad_large_text = 2131099964;
public static final int test_mtrl_calendar_day_cornerSize = 2131099965;
public static final int tooltip_corner_radius = 2131099966;
public static final int tooltip_horizontal_padding = 2131099967;
public static final int tooltip_margin = 2131099968;
public static final int tooltip_precise_anchor_extra_offset = 2131099969;
public static final int tooltip_precise_anchor_threshold = 2131099970;
public static final int tooltip_vertical_padding = 2131099971;
public static final int tooltip_y_offset_non_touch = 2131099972;
public static final int tooltip_y_offset_touch = 2131099973;
}
public static final class drawable {
public static final int $avd_hide_password__0 = <PASSWORD>;
public static final int $avd_hide_password__1 = <PASSWORD>;
public static final int $avd_hide_password__2 = <PASSWORD>186;
public static final int $avd_show_password__0 = <PASSWORD>;
public static final int $avd_show_password__1 = <PASSWORD>;
public static final int $avd_show_password__2 = <PASSWORD>;
public static final int $ic_launcher_foreground__0 = 2131165190;
public static final int abc_ab_share_pack_mtrl_alpha = 2131165191;
public static final int abc_action_bar_item_background_material = 2131165192;
public static final int abc_btn_borderless_material = 2131165193;
public static final int abc_btn_check_material = 2131165194;
public static final int abc_btn_check_material_anim = 2131165195;
public static final int abc_btn_check_to_on_mtrl_000 = 2131165196;
public static final int abc_btn_check_to_on_mtrl_015 = 2131165197;
public static final int abc_btn_colored_material = 2131165198;
public static final int abc_btn_default_mtrl_shape = 2131165199;
public static final int abc_btn_radio_material = 2131165200;
public static final int abc_btn_radio_material_anim = 2131165201;
public static final int abc_btn_radio_to_on_mtrl_000 = 2131165202;
public static final int abc_btn_radio_to_on_mtrl_015 = 2131165203;
public static final int abc_btn_switch_to_on_mtrl_00001 = 2131165204;
public static final int abc_btn_switch_to_on_mtrl_00012 = 2131165205;
public static final int abc_cab_background_internal_bg = 2131165206;
public static final int abc_cab_background_top_material = 2131165207;
public static final int abc_cab_background_top_mtrl_alpha = 2131165208;
public static final int abc_control_background_material = 2131165209;
public static final int abc_dialog_material_background = 2131165210;
public static final int abc_edit_text_material = 2131165211;
public static final int abc_ic_ab_back_material = 2131165212;
public static final int abc_ic_arrow_drop_right_black_24dp = 2131165213;
public static final int abc_ic_clear_material = 2131165214;
public static final int abc_ic_commit_search_api_mtrl_alpha = 2131165215;
public static final int abc_ic_go_search_api_material = 2131165216;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 2131165217;
public static final int abc_ic_menu_cut_mtrl_alpha = 2131165218;
public static final int abc_ic_menu_overflow_material = 2131165219;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 2131165220;
public static final int abc_ic_menu_selectall_mtrl_alpha = 2131165221;
public static final int abc_ic_menu_share_mtrl_alpha = 2131165222;
public static final int abc_ic_search_api_material = 2131165223;
public static final int abc_ic_star_black_16dp = 2131165224;
public static final int abc_ic_star_black_36dp = 2131165225;
public static final int abc_ic_star_black_48dp = 2131165226;
public static final int abc_ic_star_half_black_16dp = 2131165227;
public static final int abc_ic_star_half_black_36dp = 2131165228;
public static final int abc_ic_star_half_black_48dp = 2131165229;
public static final int abc_ic_voice_search_api_material = 2131165230;
public static final int abc_item_background_holo_dark = 2131165231;
public static final int abc_item_background_holo_light = 2131165232;
public static final int abc_list_divider_material = 2131165233;
public static final int abc_list_divider_mtrl_alpha = 2131165234;
public static final int abc_list_focused_holo = 2131165235;
public static final int abc_list_longpressed_holo = 2131165236;
public static final int abc_list_pressed_holo_dark = 2131165237;
public static final int abc_list_pressed_holo_light = 2131165238;
public static final int abc_list_selector_background_transition_holo_dark = 2131165239;
public static final int abc_list_selector_background_transition_holo_light = 2131165240;
public static final int abc_list_selector_disabled_holo_dark = 2131165241;
public static final int abc_list_selector_disabled_holo_light = 2131165242;
public static final int abc_list_selector_holo_dark = 2131165243;
public static final int abc_list_selector_holo_light = 2131165244;
public static final int abc_menu_hardkey_panel_mtrl_mult = 2131165245;
public static final int abc_popup_background_mtrl_mult = 2131165246;
public static final int abc_ratingbar_indicator_material = 2131165247;
public static final int abc_ratingbar_material = 2131165248;
public static final int abc_ratingbar_small_material = 2131165249;
public static final int abc_scrubber_control_off_mtrl_alpha = 2131165250;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 2131165251;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 2131165252;
public static final int abc_scrubber_primary_mtrl_alpha = 2131165253;
public static final int abc_scrubber_track_mtrl_alpha = 2131165254;
public static final int abc_seekbar_thumb_material = 2131165255;
public static final int abc_seekbar_tick_mark_material = 2131165256;
public static final int abc_seekbar_track_material = 2131165257;
public static final int abc_spinner_mtrl_am_alpha = 2131165258;
public static final int abc_spinner_textfield_background_material = 2131165259;
public static final int abc_switch_thumb_material = 2131165260;
public static final int abc_switch_track_mtrl_alpha = 2131165261;
public static final int abc_tab_indicator_material = 2131165262;
public static final int abc_tab_indicator_mtrl_alpha = 2131165263;
public static final int abc_text_cursor_material = 2131165264;
public static final int abc_text_select_handle_left_mtrl_dark = 2131165265;
public static final int abc_text_select_handle_left_mtrl_light = 2131165266;
public static final int abc_text_select_handle_middle_mtrl_dark = 2131165267;
public static final int abc_text_select_handle_middle_mtrl_light = 2131165268;
public static final int abc_text_select_handle_right_mtrl_dark = 2131165269;
public static final int abc_text_select_handle_right_mtrl_light = 2131165270;
public static final int abc_textfield_activated_mtrl_alpha = 2131165271;
public static final int abc_textfield_default_mtrl_alpha = 2131165272;
public static final int abc_textfield_search_activated_mtrl_alpha = 2131165273;
public static final int abc_textfield_search_default_mtrl_alpha = 2131165274;
public static final int abc_textfield_search_material = 2131165275;
public static final int abc_vector_test = 2131165276;
public static final int avd_hide_password = <PASSWORD>;
public static final int avd_show_password = <PASSWORD>;
public static final int btn_checkbox_checked_mtrl = 2131165279;
public static final int btn_checkbox_checked_to_unchecked_mtrl_animation = 2131165280;
public static final int btn_checkbox_unchecked_mtrl = 2131165281;
public static final int btn_checkbox_unchecked_to_checked_mtrl_animation = 2131165282;
public static final int btn_radio_off_mtrl = 2131165283;
public static final int btn_radio_off_to_on_mtrl_animation = 2131165284;
public static final int btn_radio_on_mtrl = 2131165285;
public static final int btn_radio_on_to_off_mtrl_animation = 2131165286;
public static final int design_bottom_navigation_item_background = 2131165287;
public static final int design_fab_background = 2131165288;
public static final int design_ic_visibility = 2131165289;
public static final int design_ic_visibility_off = 2131165290;
public static final int design_password_eye = <PASSWORD>;
public static final int design_snackbar_background = 2131165292;
public static final int gpi = 2131165293;
public static final int ic_calendar_black_24dp = 2131165294;
public static final int ic_clear_black_24dp = 2131165295;
public static final int ic_edit_black_24dp = 2131165296;
public static final int ic_keyboard_arrow_left_black_24dp = 2131165297;
public static final int ic_keyboard_arrow_right_black_24dp = 2131165298;
public static final int ic_launcher_background = 2131165299;
public static final int ic_launcher_foreground = 2131165300;
public static final int ic_menu_arrow_down_black_24dp = 2131165301;
public static final int ic_menu_arrow_up_black_24dp = 2131165302;
public static final int ic_mtrl_checked_circle = 2131165303;
public static final int ic_mtrl_chip_checked_black = 2131165304;
public static final int ic_mtrl_chip_checked_circle = 2131165305;
public static final int ic_mtrl_chip_close_circle = 2131165306;
public static final int icon = 2131165307;
public static final int icon2 = 2131165308;
public static final int mtrl_dialog_background = 2131165309;
public static final int mtrl_dropdown_arrow = 2131165310;
public static final int mtrl_ic_arrow_drop_down = 2131165311;
public static final int mtrl_ic_arrow_drop_up = 2131165312;
public static final int mtrl_ic_cancel = 2131165313;
public static final int mtrl_ic_error = 2131165314;
public static final int mtrl_popupmenu_background = 2131165315;
public static final int mtrl_popupmenu_background_dark = 2131165316;
public static final int mtrl_tabs_default_indicator = 2131165317;
public static final int navigation_empty_icon = 2131165318;
public static final int notification_action_background = 2131165319;
public static final int notification_bg = 2131165320;
public static final int notification_bg_low = 2131165321;
public static final int notification_bg_low_normal = 2131165322;
public static final int notification_bg_low_pressed = 2131165323;
public static final int notification_bg_normal = 2131165324;
public static final int notification_bg_normal_pressed = 2131165325;
public static final int notification_icon_background = 2131165326;
public static final int notification_template_icon_bg = 2131165327;
public static final int notification_template_icon_low_bg = 2131165328;
public static final int notification_tile_bg = 2131165329;
public static final int notify_panel_notification_icon_bg = 2131165330;
public static final int tbi = 2131165331;
public static final int tbo = 2131165332;
public static final int test_custom_background = 2131165333;
public static final int tooltip_frame_dark = 2131165334;
public static final int tooltip_frame_light = 2131165335;
}
public static final class id {
public static final int ALT = 2131230720;
public static final int BOTTOM_END = 2131230721;
public static final int BOTTOM_START = 2131230722;
public static final int CTRL = 2131230723;
public static final int FUNCTION = 2131230724;
public static final int META = 2131230725;
public static final int SHIFT = 2131230726;
public static final int SYM = 2131230727;
public static final int TOP_END = 2131230728;
public static final int TOP_START = 2131230729;
public static final int accessibility_action_clickable_span = 2131230730;
public static final int accessibility_custom_action_0 = 2131230731;
public static final int accessibility_custom_action_1 = 2131230732;
public static final int accessibility_custom_action_10 = 2131230733;
public static final int accessibility_custom_action_11 = 2131230734;
public static final int accessibility_custom_action_12 = 2131230735;
public static final int accessibility_custom_action_13 = 2131230736;
public static final int accessibility_custom_action_14 = 2131230737;
public static final int accessibility_custom_action_15 = 2131230738;
public static final int accessibility_custom_action_16 = 2131230739;
public static final int accessibility_custom_action_17 = 2131230740;
public static final int accessibility_custom_action_18 = 2131230741;
public static final int accessibility_custom_action_19 = 2131230742;
public static final int accessibility_custom_action_2 = 2131230743;
public static final int accessibility_custom_action_20 = 2131230744;
public static final int accessibility_custom_action_21 = 2131230745;
public static final int accessibility_custom_action_22 = 2131230746;
public static final int accessibility_custom_action_23 = 2131230747;
public static final int accessibility_custom_action_24 = 2131230748;
public static final int accessibility_custom_action_25 = 2131230749;
public static final int accessibility_custom_action_26 = 2131230750;
public static final int accessibility_custom_action_27 = 2131230751;
public static final int accessibility_custom_action_28 = 2131230752;
public static final int accessibility_custom_action_29 = 2131230753;
public static final int accessibility_custom_action_3 = 2131230754;
public static final int accessibility_custom_action_30 = 2131230755;
public static final int accessibility_custom_action_31 = 2131230756;
public static final int accessibility_custom_action_4 = 2131230757;
public static final int accessibility_custom_action_5 = 2131230758;
public static final int accessibility_custom_action_6 = 2131230759;
public static final int accessibility_custom_action_7 = 2131230760;
public static final int accessibility_custom_action_8 = 2131230761;
public static final int accessibility_custom_action_9 = 2131230762;
public static final int action_bar = 2131230763;
public static final int action_bar_activity_content = 2131230764;
public static final int action_bar_container = 2131230765;
public static final int action_bar_root = 2131230766;
public static final int action_bar_spinner = 2131230767;
public static final int action_bar_subtitle = 2131230768;
public static final int action_bar_title = 2131230769;
public static final int action_container = 2131230770;
public static final int action_context_bar = 2131230771;
public static final int action_divider = 2131230772;
public static final int action_image = 2131230773;
public static final int action_menu_divider = 2131230774;
public static final int action_menu_presenter = 2131230775;
public static final int action_mode_bar = 2131230776;
public static final int action_mode_bar_stub = 2131230777;
public static final int action_mode_close_button = 2131230778;
public static final int action_text = 2131230779;
public static final int actions = 2131230780;
public static final int activity_chooser_view_content = 2131230781;
public static final int add = 2131230782;
public static final int alertTitle = 2131230783;
public static final int all = 2131230784;
public static final int always = 2131230785;
public static final int async = 2131230786;
public static final int auto = 2131230787;
public static final int barrier = 2131230788;
public static final int beginning = 2131230789;
public static final int blocking = 2131230790;
public static final int bottom = 2131230791;
public static final int buttonPanel = 2131230792;
public static final int cancel_button = 2131230793;
public static final int center = 2131230794;
public static final int center_horizontal = 2131230795;
public static final int center_vertical = 2131230796;
public static final int chains = 2131230797;
public static final int checkbox = 2131230798;
public static final int checked = 2131230799;
public static final int chip = 2131230800;
public static final int chip_group = 2131230801;
public static final int chronometer = 2131230802;
public static final int clear_text = 2131230803;
public static final int clip_horizontal = 2131230804;
public static final int clip_vertical = 2131230805;
public static final int collapseActionView = 2131230806;
public static final int composeBtn = 2131230807;
public static final int confirm_button = 2131230808;
public static final int contactMsg = 2131230809;
public static final int contactName = 2131230810;
public static final int contactTime = 2131230811;
public static final int container = 2131230812;
public static final int content = 2131230813;
public static final int contentPanel = 2131230814;
public static final int convRl = 2131230815;
public static final int coordinator = 2131230816;
public static final int custom = 2131230817;
public static final int customPanel = 2131230818;
public static final int cut = 2131230819;
public static final int date_picker_actions = 2131230820;
public static final int decor_content_parent = 2131230821;
public static final int default_activity_button = 2131230822;
public static final int design_bottom_sheet = 2131230823;
public static final int design_menu_item_action_area = 2131230824;
public static final int design_menu_item_action_area_stub = 2131230825;
public static final int design_menu_item_text = 2131230826;
public static final int design_navigation_view = 2131230827;
public static final int dialog_button = 2131230828;
public static final int dimensions = 2131230829;
public static final int direct = 2131230830;
public static final int disableHome = 2131230831;
public static final int dropdown_menu = 2131230832;
public static final int editTextCardNumber = 2131230833;
public static final int editTextCvv = 2131230834;
public static final int editTextExpMonth = 2131230835;
public static final int editTextExpYear = 2131230836;
public static final int editTextName = 2131230837;
public static final int edit_query = 2131230838;
public static final int end = 2131230839;
public static final int enterAlways = 2131230840;
public static final int enterAlwaysCollapsed = 2131230841;
public static final int exitUntilCollapsed = 2131230842;
public static final int expand_activities_button = 2131230843;
public static final int expanded_menu = 2131230844;
public static final int fade = 2131230845;
public static final int fill = 2131230846;
public static final int fill_horizontal = 2131230847;
public static final int fill_vertical = 2131230848;
public static final int filled = 2131230849;
public static final int filter_chip = 2131230850;
public static final int fitToContents = 2131230851;
public static final int fixed = 2131230852;
public static final int forever = 2131230853;
public static final int ghost_view = 2131230854;
public static final int ghost_view_holder = 2131230855;
public static final int gone = 2131230856;
public static final int group_divider = 2131230857;
public static final int groups = 2131230858;
public static final int hideable = 2131230859;
public static final int home = 2131230860;
public static final int homeAsUp = 2131230861;
public static final int icon = 2131230862;
public static final int icon_group = 2131230863;
public static final int ifRoom = 2131230864;
public static final int image = 2131230865;
public static final int imageView = 2131230866;
public static final int info = 2131230867;
public static final int invisible = 2131230868;
public static final int italic = 2131230869;
public static final int item_touch_helper_previous_elevation = 2131230870;
public static final int labeled = 2131230871;
public static final int largeLabel = 2131230872;
public static final int layout = 2131230873;
public static final int left = 2131230874;
public static final int line1 = 2131230875;
public static final int line3 = 2131230876;
public static final int listMode = 2131230877;
public static final int listView = 2131230878;
public static final int list_item = 2131230879;
public static final int llExp = 2131230880;
public static final int masked = 2131230881;
public static final int message = 2131230882;
public static final int middle = 2131230883;
public static final int mini = 2131230884;
public static final int month_grid = 2131230885;
public static final int month_navigation_bar = 2131230886;
public static final int month_navigation_fragment_toggle = 2131230887;
public static final int month_navigation_next = 2131230888;
public static final int month_navigation_previous = 2131230889;
public static final int month_title = 2131230890;
public static final int mtrl_calendar_day_selector_frame = 2131230891;
public static final int mtrl_calendar_days_of_week = 2131230892;
public static final int mtrl_calendar_frame = 2131230893;
public static final int mtrl_calendar_main_pane = 2131230894;
public static final int mtrl_calendar_months = 2131230895;
public static final int mtrl_calendar_selection_frame = 2131230896;
public static final int mtrl_calendar_text_input_frame = 2131230897;
public static final int mtrl_calendar_year_selector_frame = 2131230898;
public static final int mtrl_card_checked_layer_id = 2131230899;
public static final int mtrl_child_content_container = 2131230900;
public static final int mtrl_internal_children_alpha_tag = 2131230901;
public static final int mtrl_picker_fullscreen = 2131230902;
public static final int mtrl_picker_header = 2131230903;
public static final int mtrl_picker_header_selection_text = 2131230904;
public static final int mtrl_picker_header_title_and_selection = 2131230905;
public static final int mtrl_picker_header_toggle = 2131230906;
public static final int mtrl_picker_text_input_date = 2131230907;
public static final int mtrl_picker_text_input_range_end = 2131230908;
public static final int mtrl_picker_text_input_range_start = 2131230909;
public static final int mtrl_picker_title_text = 2131230910;
public static final int multiply = 2131230911;
public static final int navigation_header_container = 2131230912;
public static final int never = 2131230913;
public static final int noScroll = 2131230914;
public static final int none = 2131230915;
public static final int normal = 2131230916;
public static final int notification_background = 2131230917;
public static final int notification_main_column = 2131230918;
public static final int notification_main_column_container = 2131230919;
public static final int off = 2131230920;
public static final int on = 2131230921;
public static final int outline = 2131230922;
public static final int packed = 2131230923;
public static final int parallax = 2131230924;
public static final int parent = 2131230925;
public static final int parentPanel = 2131230926;
public static final int parent_matrix = 2131230927;
public static final int password_toggle = 2131230928;
public static final int peekHeight = 2131230929;
public static final int percent = 2131230930;
public static final int pin = 2131230931;
public static final int progress_circular = 2131230932;
public static final int progress_horizontal = 2131230933;
public static final int radio = 2131230934;
public static final int right = 2131230935;
public static final int right_icon = 2131230936;
public static final int right_side = 2131230937;
public static final int rlControl = 2131230938;
public static final int rounded = 2131230939;
public static final int save_non_transition_alpha = 2131230940;
public static final int save_overlay_view = 2131230941;
public static final int scale = 2131230942;
public static final int screen = 2131230943;
public static final int scroll = 2131230944;
public static final int scrollIndicatorDown = 2131230945;
public static final int scrollIndicatorUp = 2131230946;
public static final int scrollView = 2131230947;
public static final int scrollable = 2131230948;
public static final int search_badge = 2131230949;
public static final int search_bar = 2131230950;
public static final int search_button = 2131230951;
public static final int search_close_btn = 2131230952;
public static final int search_edit_frame = 2131230953;
public static final int search_go_btn = 2131230954;
public static final int search_mag_icon = 2131230955;
public static final int search_plate = 2131230956;
public static final int search_src_text = 2131230957;
public static final int search_voice_btn = 2131230958;
public static final int select_dialog_listview = 2131230959;
public static final int selected = 2131230960;
public static final int sendSmsBtn = 2131230961;
public static final int shortcut = 2131230962;
public static final int showCustom = 2131230963;
public static final int showHome = 2131230964;
public static final int showTitle = 2131230965;
public static final int skipCollapsed = 2131230966;
public static final int slide = 2131230967;
public static final int smallLabel = 2131230968;
public static final int smsEditText = 2131230969;
public static final int snackbar_action = 2131230970;
public static final int snackbar_text = 2131230971;
public static final int snap = 2131230972;
public static final int snapMargins = 2131230973;
public static final int spacer = 2131230974;
public static final int split_action_bar = 2131230975;
public static final int spread = 2131230976;
public static final int spread_inside = 2131230977;
public static final int src_atop = 2131230978;
public static final int src_in = 2131230979;
public static final int src_over = 2131230980;
public static final int standard = 2131230981;
public static final int start = 2131230982;
public static final int stretch = 2131230983;
public static final int submenuarrow = 2131230984;
public static final int submitBtn = 2131230985;
public static final int submit_area = 2131230986;
public static final int tabLayout = 2131230987;
public static final int tabMode = 2131230988;
public static final int tag_accessibility_actions = 2131230989;
public static final int tag_accessibility_clickable_spans = 2131230990;
public static final int tag_accessibility_heading = 2131230991;
public static final int tag_accessibility_pane_title = 2131230992;
public static final int tag_screen_reader_focusable = 2131230993;
public static final int tag_transition_group = 2131230994;
public static final int tag_unhandled_key_event_manager = 2131230995;
public static final int tag_unhandled_key_listeners = 2131230996;
public static final int test_checkbox_android_button_tint = 2131230997;
public static final int test_checkbox_app_button_tint = 2131230998;
public static final int text = 2131230999;
public static final int text2 = 2131231000;
public static final int textEnd = 2131231001;
public static final int textSpacerNoButtons = 2131231002;
public static final int textSpacerNoTitle = 2131231003;
public static final int textStart = 2131231004;
public static final int textViewDesc = 2131231005;
public static final int textViewExp = 2131231006;
public static final int textViewTitle = 2131231007;
public static final int text_appname = 2131231008;
public static final int text_input_end_icon = 2131231009;
public static final int text_input_start_icon = 2131231010;
public static final int text_message = 2131231011;
public static final int text_title = 2131231012;
public static final int textinput_counter = 2131231013;
public static final int textinput_error = 2131231014;
public static final int textinput_helper_text = 2131231015;
public static final int time = 2131231016;
public static final int title = 2131231017;
public static final int titleDividerNoCustom = 2131231018;
public static final int title_template = 2131231019;
public static final int top = 2131231020;
public static final int topPanel = 2131231021;
public static final int touch_outside = 2131231022;
public static final int transition_current_scene = 2131231023;
public static final int transition_layout_save = 2131231024;
public static final int transition_position = 2131231025;
public static final int transition_scene_layoutid_cache = 2131231026;
public static final int transition_transform = 2131231027;
public static final int unchecked = 2131231028;
public static final int uniform = 2131231029;
public static final int unlabeled = 2131231030;
public static final int up = 2131231031;
public static final int useLogo = 2131231032;
public static final int view_offset_helper = 2131231033;
public static final int visible = 2131231034;
public static final int webView = 2131231035;
public static final int withText = 2131231036;
public static final int wrap = 2131231037;
public static final int wrap_content = 2131231038;
}
public static final class integer {
public static final int abc_config_activityDefaultDur = 2131296256;
public static final int abc_config_activityShortDur = 2131296257;
public static final int app_bar_elevation_anim_duration = 2131296258;
public static final int bottom_sheet_slide_duration = 2131296259;
public static final int cancel_button_image_alpha = 2131296260;
public static final int config_tooltipAnimTime = 2131296261;
public static final int design_snackbar_text_max_lines = 2131296262;
public static final int design_tab_indicator_anim_duration_ms = 2131296263;
public static final int hide_password_duration = 2131296264;
public static final int mtrl_badge_max_character_count = 2131296265;
public static final int mtrl_btn_anim_delay_ms = 2131296266;
public static final int mtrl_btn_anim_duration_ms = 2131296267;
public static final int mtrl_calendar_header_orientation = 2131296268;
public static final int mtrl_calendar_selection_text_lines = 2131296269;
public static final int mtrl_calendar_year_selector_span = 2131296270;
public static final int mtrl_card_anim_delay_ms = 2131296271;
public static final int mtrl_card_anim_duration_ms = 2131296272;
public static final int mtrl_chip_anim_duration = 2131296273;
public static final int mtrl_tab_indicator_anim_duration_ms = 2131296274;
public static final int show_password_duration = 2131296275;
public static final int status_bar_notification_info_maxnum = 2131296276;
}
public static final class interpolator {
public static final int btn_checkbox_checked_mtrl_animation_interpolator_0 = 2131361792;
public static final int btn_checkbox_checked_mtrl_animation_interpolator_1 = 2131361793;
public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_0 = 2131361794;
public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_1 = 2131361795;
public static final int btn_radio_to_off_mtrl_animation_interpolator_0 = 2131361796;
public static final int btn_radio_to_on_mtrl_animation_interpolator_0 = 2131361797;
public static final int fast_out_slow_in = 2131361798;
public static final int mtrl_fast_out_linear_in = 2131361799;
public static final int mtrl_fast_out_slow_in = 2131361800;
public static final int mtrl_linear = 2131361801;
public static final int mtrl_linear_out_slow_in = 2131361802;
}
public static final class layout {
public static final int abc_action_bar_title_item = 2131427328;
public static final int abc_action_bar_up_container = 2131427329;
public static final int abc_action_menu_item_layout = 2131427330;
public static final int abc_action_menu_layout = 2131427331;
public static final int abc_action_mode_bar = 2131427332;
public static final int abc_action_mode_close_item_material = 2131427333;
public static final int abc_activity_chooser_view = 2131427334;
public static final int abc_activity_chooser_view_list_item = 2131427335;
public static final int abc_alert_dialog_button_bar_material = 2131427336;
public static final int abc_alert_dialog_material = 2131427337;
public static final int abc_alert_dialog_title_material = 2131427338;
public static final int abc_cascading_menu_item_layout = 2131427339;
public static final int abc_dialog_title_material = 2131427340;
public static final int abc_expanded_menu_layout = 2131427341;
public static final int abc_list_menu_item_checkbox = 2131427342;
public static final int abc_list_menu_item_icon = 2131427343;
public static final int abc_list_menu_item_layout = 2131427344;
public static final int abc_list_menu_item_radio = 2131427345;
public static final int abc_popup_menu_header_item_layout = 2131427346;
public static final int abc_popup_menu_item_layout = 2131427347;
public static final int abc_screen_content_include = 2131427348;
public static final int abc_screen_simple = 2131427349;
public static final int abc_screen_simple_overlay_action_mode = 2131427350;
public static final int abc_screen_toolbar = 2131427351;
public static final int abc_search_dropdown_item_icons_2line = 2131427352;
public static final int abc_search_view = 2131427353;
public static final int abc_select_dialog_material = 2131427354;
public static final int abc_tooltip = 2131427355;
public static final int activity_browser = 2131427356;
public static final int activity_card = 2131427357;
public static final int activity_compose_sms = 2131427358;
public static final int activity_intent_starter = 2131427359;
public static final int activity_main = 2131427360;
public static final int activity_sms_thread = 2131427361;
public static final int conv_list_item = 2131427362;
public static final int custom_dialog = 2131427363;
public static final int design_bottom_navigation_item = 2131427364;
public static final int design_bottom_sheet_dialog = 2131427365;
public static final int design_layout_snackbar = 2131427366;
public static final int design_layout_snackbar_include = 2131427367;
public static final int design_layout_tab_icon = 2131427368;
public static final int design_layout_tab_text = 2131427369;
public static final int design_menu_item_action_area = 2131427370;
public static final int design_navigation_item = 2131427371;
public static final int design_navigation_item_header = 2131427372;
public static final int design_navigation_item_separator = 2131427373;
public static final int design_navigation_item_subheader = 2131427374;
public static final int design_navigation_menu = 2131427375;
public static final int design_navigation_menu_item = 2131427376;
public static final int design_text_input_end_icon = 2131427377;
public static final int design_text_input_start_icon = 2131427378;
public static final int mtrl_alert_dialog = 2131427379;
public static final int mtrl_alert_dialog_actions = 2131427380;
public static final int mtrl_alert_dialog_title = 2131427381;
public static final int mtrl_alert_select_dialog_item = 2131427382;
public static final int mtrl_alert_select_dialog_multichoice = 2131427383;
public static final int mtrl_alert_select_dialog_singlechoice = 2131427384;
public static final int mtrl_calendar_day = 2131427385;
public static final int mtrl_calendar_day_of_week = 2131427386;
public static final int mtrl_calendar_days_of_week = 2131427387;
public static final int mtrl_calendar_horizontal = 2131427388;
public static final int mtrl_calendar_month = 2131427389;
public static final int mtrl_calendar_month_labeled = 2131427390;
public static final int mtrl_calendar_month_navigation = 2131427391;
public static final int mtrl_calendar_months = 2131427392;
public static final int mtrl_calendar_vertical = 2131427393;
public static final int mtrl_calendar_year = 2131427394;
public static final int mtrl_layout_snackbar = 2131427395;
public static final int mtrl_layout_snackbar_include = 2131427396;
public static final int mtrl_picker_actions = 2131427397;
public static final int mtrl_picker_dialog = 2131427398;
public static final int mtrl_picker_fullscreen = 2131427399;
public static final int mtrl_picker_header_dialog = 2131427400;
public static final int mtrl_picker_header_fullscreen = 2131427401;
public static final int mtrl_picker_header_selection_text = 2131427402;
public static final int mtrl_picker_header_title_text = 2131427403;
public static final int mtrl_picker_header_toggle = 2131427404;
public static final int mtrl_picker_text_input_date = 2131427405;
public static final int mtrl_picker_text_input_date_range = 2131427406;
public static final int notif_custom_empty = 2131427407;
public static final int notif_custom_view = 2131427408;
public static final int notification_action = 2131427409;
public static final int notification_action_tombstone = 2131427410;
public static final int notification_template_custom_big = 2131427411;
public static final int notification_template_icon_group = 2131427412;
public static final int notification_template_part_chronometer = 2131427413;
public static final int notification_template_part_time = 2131427414;
public static final int select_dialog_item_material = 2131427415;
public static final int select_dialog_multichoice_material = 2131427416;
public static final int select_dialog_singlechoice_material = 2131427417;
public static final int support_simple_spinner_dropdown_item = 2131427418;
public static final int test_action_chip = 2131427419;
public static final int test_design_checkbox = 2131427420;
public static final int test_reflow_chipgroup = 2131427421;
public static final int test_toolbar = 2131427422;
public static final int test_toolbar_custom_background = 2131427423;
public static final int test_toolbar_elevation = 2131427424;
public static final int test_toolbar_surface = 2131427425;
public static final int text_view_with_line_height_from_appearance = 2131427426;
public static final int text_view_with_line_height_from_layout = 2131427427;
public static final int text_view_with_line_height_from_style = 2131427428;
public static final int text_view_with_theme_line_height = 2131427429;
public static final int text_view_without_line_height = 2131427430;
}
public static final class menu {
public static final int menu = 2131492864;
}
public static final class mipmap {
public static final int ic_launcher = 2131558400;
public static final int ic_launcher_round = 2131558401;
}
public static final class plurals {
public static final int mtrl_badge_content_description = 2131623936;
}
public static final class string {
public static final int abc_action_bar_home_description = 2131689472;
public static final int abc_action_bar_up_description = 2131689473;
public static final int abc_action_menu_overflow_description = 2131689474;
public static final int abc_action_mode_done = 2131689475;
public static final int abc_activity_chooser_view_see_all = 2131689476;
public static final int abc_activitychooserview_choose_application = 2131689477;
public static final int abc_capital_off = 2131689478;
public static final int abc_capital_on = 2131689479;
public static final int abc_menu_alt_shortcut_label = 2131689480;
public static final int abc_menu_ctrl_shortcut_label = 2131689481;
public static final int abc_menu_delete_shortcut_label = 2131689482;
public static final int abc_menu_enter_shortcut_label = 2131689483;
public static final int abc_menu_function_shortcut_label = 2131689484;
public static final int abc_menu_meta_shortcut_label = 2131689485;
public static final int abc_menu_shift_shortcut_label = 2131689486;
public static final int abc_menu_space_shortcut_label = 2131689487;
public static final int abc_menu_sym_shortcut_label = 2131689488;
public static final int abc_prepend_shortcut_label = 2131689489;
public static final int abc_search_hint = 2131689490;
public static final int abc_searchview_description_clear = 2131689491;
public static final int abc_searchview_description_query = 2131689492;
public static final int abc_searchview_description_search = 2131689493;
public static final int abc_searchview_description_submit = 2131689494;
public static final int abc_searchview_description_voice = 2131689495;
public static final int abc_shareactionprovider_share_with = 2131689496;
public static final int abc_shareactionprovider_share_with_application = 2131689497;
public static final int abc_toolbar_collapse_description = 2131689498;
public static final int accessibility_service_description = 2131689499;
public static final int app_name = 2131689500;
public static final int appbar_scrolling_view_behavior = 2131689501;
public static final int bottom_sheet_behavior = 2131689502;
public static final int character_counter_content_description = 2131689503;
public static final int character_counter_overflowed_content_description = 2131689504;
public static final int character_counter_pattern = 2131689505;
public static final int chip_text = 2131689506;
public static final int clear_text_end_icon_content_description = 2131689507;
public static final int error_icon_content_description = 2131689508;
public static final int exposed_dropdown_menu_content_description = 2131689509;
public static final int fab_transformation_scrim_behavior = 2131689510;
public static final int fab_transformation_sheet_behavior = 2131689511;
public static final int hide_bottom_view_on_scroll_behavior = 2131689512;
public static final int icon_content_description = 2131689513;
public static final int mtrl_badge_numberless_content_description = 2131689514;
public static final int mtrl_chip_close_icon_content_description = 2131689515;
public static final int mtrl_exceed_max_badge_number_suffix = 2131689516;
public static final int mtrl_picker_a11y_next_month = 2131689517;
public static final int mtrl_picker_a11y_prev_month = 2131689518;
public static final int mtrl_picker_announce_current_selection = 2131689519;
public static final int mtrl_picker_cancel = 2131689520;
public static final int mtrl_picker_confirm = 2131689521;
public static final int mtrl_picker_date_header_selected = 2131689522;
public static final int mtrl_picker_date_header_title = 2131689523;
public static final int mtrl_picker_date_header_unselected = 2131689524;
public static final int mtrl_picker_day_of_week_column_header = 2131689525;
public static final int mtrl_picker_invalid_format = 2131689526;
public static final int mtrl_picker_invalid_format_example = 2131689527;
public static final int mtrl_picker_invalid_format_use = 2131689528;
public static final int mtrl_picker_invalid_range = 2131689529;
public static final int mtrl_picker_navigate_to_year_description = 2131689530;
public static final int mtrl_picker_out_of_range = 2131689531;
public static final int mtrl_picker_range_header_only_end_selected = 2131689532;
public static final int mtrl_picker_range_header_only_start_selected = 2131689533;
public static final int mtrl_picker_range_header_selected = 2131689534;
public static final int mtrl_picker_range_header_title = 2131689535;
public static final int mtrl_picker_range_header_unselected = 2131689536;
public static final int mtrl_picker_save = 2131689537;
public static final int mtrl_picker_text_input_date_hint = 2131689538;
public static final int mtrl_picker_text_input_date_range_end_hint = 2131689539;
public static final int mtrl_picker_text_input_date_range_start_hint = 2131689540;
public static final int mtrl_picker_text_input_day_abbr = 2131689541;
public static final int mtrl_picker_text_input_month_abbr = 2131689542;
public static final int mtrl_picker_text_input_year_abbr = 2131689543;
public static final int mtrl_picker_toggle_to_calendar_input_mode = 2131689544;
public static final int mtrl_picker_toggle_to_day_selection = 2131689545;
public static final int mtrl_picker_toggle_to_text_input_mode = 2131689546;
public static final int mtrl_picker_toggle_to_year_selection = 2131689547;
public static final int password_toggle_content_description = 2131689548;
public static final int path_password_eye = <PASSWORD>;
public static final int path_password_eye_mask_strike_through = 2131689550;
public static final int path_password_eye_mask_visible = 2131689551;
public static final int path_password_strike_through = 2131689552;
public static final int search_menu_title = 2131689553;
public static final int status_bar_notification_info_overflow = 2131689554;
}
public static final class style {
public static final int AlertDialog_AppCompat = 2131755008;
public static final int AlertDialog_AppCompat_Light = 2131755009;
public static final int Animation_AppCompat_Dialog = 2131755010;
public static final int Animation_AppCompat_DropDownUp = 2131755011;
public static final int Animation_AppCompat_Tooltip = 2131755012;
public static final int Animation_Design_BottomSheetDialog = 2131755013;
public static final int Animation_MaterialComponents_BottomSheetDialog = 2131755014;
public static final int Base_AlertDialog_AppCompat = 2131755015;
public static final int Base_AlertDialog_AppCompat_Light = 2131755016;
public static final int Base_Animation_AppCompat_Dialog = 2131755017;
public static final int Base_Animation_AppCompat_DropDownUp = 2131755018;
public static final int Base_Animation_AppCompat_Tooltip = 2131755019;
public static final int Base_CardView = 2131755020;
public static final int Base_DialogWindowTitle_AppCompat = 2131755021;
public static final int Base_DialogWindowTitleBackground_AppCompat = 2131755022;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Icon = 2131755023;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Panel = 2131755024;
public static final int Base_MaterialAlertDialog_MaterialComponents_Title_Text = 2131755025;
public static final int Base_TextAppearance_AppCompat = 2131755026;
public static final int Base_TextAppearance_AppCompat_Body1 = 2131755027;
public static final int Base_TextAppearance_AppCompat_Body2 = 2131755028;
public static final int Base_TextAppearance_AppCompat_Button = 2131755029;
public static final int Base_TextAppearance_AppCompat_Caption = 2131755030;
public static final int Base_TextAppearance_AppCompat_Display1 = 2131755031;
public static final int Base_TextAppearance_AppCompat_Display2 = 2131755032;
public static final int Base_TextAppearance_AppCompat_Display3 = 2131755033;
public static final int Base_TextAppearance_AppCompat_Display4 = 2131755034;
public static final int Base_TextAppearance_AppCompat_Headline = 2131755035;
public static final int Base_TextAppearance_AppCompat_Inverse = 2131755036;
public static final int Base_TextAppearance_AppCompat_Large = 2131755037;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 2131755038;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131755039;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131755040;
public static final int Base_TextAppearance_AppCompat_Medium = 2131755041;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 2131755042;
public static final int Base_TextAppearance_AppCompat_Menu = 2131755043;
public static final int Base_TextAppearance_AppCompat_SearchResult = 2131755044;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131755045;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 2131755046;
public static final int Base_TextAppearance_AppCompat_Small = 2131755047;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 2131755048;
public static final int Base_TextAppearance_AppCompat_Subhead = 2131755049;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131755050;
public static final int Base_TextAppearance_AppCompat_Title = 2131755051;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 2131755052;
public static final int Base_TextAppearance_AppCompat_Tooltip = 2131755053;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131755054;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131755055;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131755056;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131755057;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131755058;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131755059;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131755060;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 2131755061;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131755062;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 2131755063;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131755064;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131755065;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131755066;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131755067;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131755068;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 2131755069;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131755070;
public static final int Base_TextAppearance_MaterialComponents_Badge = 2131755071;
public static final int Base_TextAppearance_MaterialComponents_Button = 2131755072;
public static final int Base_TextAppearance_MaterialComponents_Headline6 = 2131755073;
public static final int Base_TextAppearance_MaterialComponents_Subtitle2 = 2131755074;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131755075;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131755076;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131755077;
public static final int Base_Theme_AppCompat = 2131755078;
public static final int Base_Theme_AppCompat_CompactMenu = 2131755079;
public static final int Base_Theme_AppCompat_Dialog = 2131755080;
public static final int Base_Theme_AppCompat_Dialog_Alert = 2131755081;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 2131755082;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 2131755083;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 2131755084;
public static final int Base_Theme_AppCompat_Light = 2131755085;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 2131755086;
public static final int Base_Theme_AppCompat_Light_Dialog = 2131755087;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 2131755088;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131755089;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131755090;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131755091;
public static final int Base_Theme_MaterialComponents = 2131755092;
public static final int Base_Theme_MaterialComponents_Bridge = 2131755093;
public static final int Base_Theme_MaterialComponents_CompactMenu = 2131755094;
public static final int Base_Theme_MaterialComponents_Dialog = 2131755095;
public static final int Base_Theme_MaterialComponents_Dialog_Alert = 2131755096;
public static final int Base_Theme_MaterialComponents_Dialog_Bridge = 2131755097;
public static final int Base_Theme_MaterialComponents_Dialog_FixedSize = 2131755098;
public static final int Base_Theme_MaterialComponents_Dialog_MinWidth = 2131755099;
public static final int Base_Theme_MaterialComponents_DialogWhenLarge = 2131755100;
public static final int Base_Theme_MaterialComponents_Light = 2131755101;
public static final int Base_Theme_MaterialComponents_Light_Bridge = 2131755102;
public static final int Base_Theme_MaterialComponents_Light_DarkActionBar = 2131755103;
public static final int Base_Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755104;
public static final int Base_Theme_MaterialComponents_Light_Dialog = 2131755105;
public static final int Base_Theme_MaterialComponents_Light_Dialog_Alert = 2131755106;
public static final int Base_Theme_MaterialComponents_Light_Dialog_Bridge = 2131755107;
public static final int Base_Theme_MaterialComponents_Light_Dialog_FixedSize = 2131755108;
public static final int Base_Theme_MaterialComponents_Light_Dialog_MinWidth = 2131755109;
public static final int Base_Theme_MaterialComponents_Light_DialogWhenLarge = 2131755110;
public static final int Base_ThemeOverlay_AppCompat = 2131755111;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 2131755112;
public static final int Base_ThemeOverlay_AppCompat_Dark = 2131755113;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131755114;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 2131755115;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 2131755116;
public static final int Base_ThemeOverlay_AppCompat_Light = 2131755117;
public static final int Base_ThemeOverlay_MaterialComponents_Dialog = 2131755118;
public static final int Base_ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755119;
public static final int Base_ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755120;
public static final int Base_V14_Theme_MaterialComponents = 2131755121;
public static final int Base_V14_Theme_MaterialComponents_Bridge = 2131755122;
public static final int Base_V14_Theme_MaterialComponents_Dialog = 2131755123;
public static final int Base_V14_Theme_MaterialComponents_Dialog_Bridge = 2131755124;
public static final int Base_V14_Theme_MaterialComponents_Light = 2131755125;
public static final int Base_V14_Theme_MaterialComponents_Light_Bridge = 2131755126;
public static final int Base_V14_Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755127;
public static final int Base_V14_Theme_MaterialComponents_Light_Dialog = 2131755128;
public static final int Base_V14_Theme_MaterialComponents_Light_Dialog_Bridge = 2131755129;
public static final int Base_V14_ThemeOverlay_MaterialComponents_Dialog = 2131755130;
public static final int Base_V14_ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755131;
public static final int Base_V14_ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755132;
public static final int Base_V21_Theme_AppCompat = 2131755133;
public static final int Base_V21_Theme_AppCompat_Dialog = 2131755134;
public static final int Base_V21_Theme_AppCompat_Light = 2131755135;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 2131755136;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 2131755137;
public static final int Base_V22_Theme_AppCompat = 2131755138;
public static final int Base_V22_Theme_AppCompat_Light = 2131755139;
public static final int Base_V23_Theme_AppCompat = 2131755140;
public static final int Base_V23_Theme_AppCompat_Light = 2131755141;
public static final int Base_V26_Theme_AppCompat = 2131755142;
public static final int Base_V26_Theme_AppCompat_Light = 2131755143;
public static final int Base_V26_Widget_AppCompat_Toolbar = 2131755144;
public static final int Base_V28_Theme_AppCompat = 2131755145;
public static final int Base_V28_Theme_AppCompat_Light = 2131755146;
public static final int Base_V7_Theme_AppCompat = 2131755147;
public static final int Base_V7_Theme_AppCompat_Dialog = 2131755148;
public static final int Base_V7_Theme_AppCompat_Light = 2131755149;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 2131755150;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 2131755151;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131755152;
public static final int Base_V7_Widget_AppCompat_EditText = 2131755153;
public static final int Base_V7_Widget_AppCompat_Toolbar = 2131755154;
public static final int Base_Widget_AppCompat_ActionBar = 2131755155;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 2131755156;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 2131755157;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 2131755158;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 2131755159;
public static final int Base_Widget_AppCompat_ActionButton = 2131755160;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 2131755161;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 2131755162;
public static final int Base_Widget_AppCompat_ActionMode = 2131755163;
public static final int Base_Widget_AppCompat_ActivityChooserView = 2131755164;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 2131755165;
public static final int Base_Widget_AppCompat_Button = 2131755166;
public static final int Base_Widget_AppCompat_Button_Borderless = 2131755167;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 2131755168;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131755169;
public static final int Base_Widget_AppCompat_Button_Colored = 2131755170;
public static final int Base_Widget_AppCompat_Button_Small = 2131755171;
public static final int Base_Widget_AppCompat_ButtonBar = 2131755172;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131755173;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131755174;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131755175;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 2131755176;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 2131755177;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131755178;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 2131755179;
public static final int Base_Widget_AppCompat_EditText = 2131755180;
public static final int Base_Widget_AppCompat_ImageButton = 2131755181;
public static final int Base_Widget_AppCompat_Light_ActionBar = 2131755182;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131755183;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131755184;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131755185;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131755186;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131755187;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 2131755188;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131755189;
public static final int Base_Widget_AppCompat_ListMenuView = 2131755190;
public static final int Base_Widget_AppCompat_ListPopupWindow = 2131755191;
public static final int Base_Widget_AppCompat_ListView = 2131755192;
public static final int Base_Widget_AppCompat_ListView_DropDown = 2131755193;
public static final int Base_Widget_AppCompat_ListView_Menu = 2131755194;
public static final int Base_Widget_AppCompat_PopupMenu = 2131755195;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 2131755196;
public static final int Base_Widget_AppCompat_PopupWindow = 2131755197;
public static final int Base_Widget_AppCompat_ProgressBar = 2131755198;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131755199;
public static final int Base_Widget_AppCompat_RatingBar = 2131755200;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 2131755201;
public static final int Base_Widget_AppCompat_RatingBar_Small = 2131755202;
public static final int Base_Widget_AppCompat_SearchView = 2131755203;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 2131755204;
public static final int Base_Widget_AppCompat_SeekBar = 2131755205;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 2131755206;
public static final int Base_Widget_AppCompat_Spinner = 2131755207;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 2131755208;
public static final int Base_Widget_AppCompat_TextView = 2131755209;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 2131755210;
public static final int Base_Widget_AppCompat_Toolbar = 2131755211;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131755212;
public static final int Base_Widget_Design_TabLayout = 2131755213;
public static final int Base_Widget_MaterialComponents_AutoCompleteTextView = 2131755214;
public static final int Base_Widget_MaterialComponents_CheckedTextView = 2131755215;
public static final int Base_Widget_MaterialComponents_Chip = 2131755216;
public static final int Base_Widget_MaterialComponents_PopupMenu = 2131755217;
public static final int Base_Widget_MaterialComponents_PopupMenu_ContextMenu = 2131755218;
public static final int Base_Widget_MaterialComponents_PopupMenu_ListPopupWindow = 2131755219;
public static final int Base_Widget_MaterialComponents_PopupMenu_Overflow = 2131755220;
public static final int Base_Widget_MaterialComponents_TextInputEditText = 2131755221;
public static final int Base_Widget_MaterialComponents_TextInputLayout = 2131755222;
public static final int Base_Widget_MaterialComponents_TextView = 2131755223;
public static final int CardView = 2131755224;
public static final int CardView_Dark = 2131755225;
public static final int CardView_Light = 2131755226;
public static final int EmptyTheme = 2131755227;
public static final int MaterialAlertDialog_MaterialComponents = 2131755228;
public static final int MaterialAlertDialog_MaterialComponents_Body_Text = 2131755229;
public static final int MaterialAlertDialog_MaterialComponents_Picker_Date_Calendar = 2131755230;
public static final int MaterialAlertDialog_MaterialComponents_Picker_Date_Spinner = 2131755231;
public static final int MaterialAlertDialog_MaterialComponents_Title_Icon = 2131755232;
public static final int MaterialAlertDialog_MaterialComponents_Title_Icon_CenterStacked = 2131755233;
public static final int MaterialAlertDialog_MaterialComponents_Title_Panel = 2131755234;
public static final int MaterialAlertDialog_MaterialComponents_Title_Panel_CenterStacked = 2131755235;
public static final int MaterialAlertDialog_MaterialComponents_Title_Text = 2131755236;
public static final int MaterialAlertDialog_MaterialComponents_Title_Text_CenterStacked = 2131755237;
public static final int Platform_AppCompat = 2131755238;
public static final int Platform_AppCompat_Light = 2131755239;
public static final int Platform_MaterialComponents = 2131755240;
public static final int Platform_MaterialComponents_Dialog = 2131755241;
public static final int Platform_MaterialComponents_Light = 2131755242;
public static final int Platform_MaterialComponents_Light_Dialog = 2131755243;
public static final int Platform_ThemeOverlay_AppCompat = 2131755244;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 2131755245;
public static final int Platform_ThemeOverlay_AppCompat_Light = 2131755246;
public static final int Platform_V21_AppCompat = 2131755247;
public static final int Platform_V21_AppCompat_Light = 2131755248;
public static final int Platform_V25_AppCompat = 2131755249;
public static final int Platform_V25_AppCompat_Light = 2131755250;
public static final int Platform_Widget_AppCompat_Spinner = 2131755251;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 2131755252;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131755253;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131755254;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131755255;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131755256;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 2131755257;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 2131755258;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131755259;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 2131755260;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131755261;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131755262;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131755263;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131755264;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131755265;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131755266;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 2131755267;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131755268;
public static final int ShapeAppearance_MaterialComponents = 2131755269;
public static final int ShapeAppearance_MaterialComponents_LargeComponent = 2131755270;
public static final int ShapeAppearance_MaterialComponents_MediumComponent = 2131755271;
public static final int ShapeAppearance_MaterialComponents_SmallComponent = 2131755272;
public static final int ShapeAppearance_MaterialComponents_Test = 2131755273;
public static final int ShapeAppearanceOverlay = 2131755274;
public static final int ShapeAppearanceOverlay_BottomLeftDifferentCornerSize = 2131755275;
public static final int ShapeAppearanceOverlay_BottomRightCut = 2131755276;
public static final int ShapeAppearanceOverlay_Cut = 2131755277;
public static final int ShapeAppearanceOverlay_DifferentCornerSize = 2131755278;
public static final int ShapeAppearanceOverlay_MaterialComponents_BottomSheet = 2131755279;
public static final int ShapeAppearanceOverlay_MaterialComponents_Chip = 2131755280;
public static final int ShapeAppearanceOverlay_MaterialComponents_ExtendedFloatingActionButton = 2131755281;
public static final int ShapeAppearanceOverlay_MaterialComponents_FloatingActionButton = 2131755282;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Day = 2131755283;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Window_Fullscreen = 2131755284;
public static final int ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Year = 2131755285;
public static final int ShapeAppearanceOverlay_MaterialComponents_TextInputLayout_FilledBox = 2131755286;
public static final int ShapeAppearanceOverlay_TopLeftCut = 2131755287;
public static final int ShapeAppearanceOverlay_TopRightDifferentCornerSize = 2131755288;
public static final int Test_ShapeAppearanceOverlay_MaterialComponents_MaterialCalendar_Day = 2131755289;
public static final int Test_Theme_MaterialComponents_MaterialCalendar = 2131755290;
public static final int Test_Widget_MaterialComponents_MaterialCalendar = 2131755291;
public static final int Test_Widget_MaterialComponents_MaterialCalendar_Day = 2131755292;
public static final int Test_Widget_MaterialComponents_MaterialCalendar_Day_Selected = 2131755293;
public static final int TestStyleWithLineHeight = 2131755294;
public static final int TestStyleWithLineHeightAppearance = 2131755295;
public static final int TestStyleWithThemeLineHeightAttribute = 2131755296;
public static final int TestStyleWithoutLineHeight = 2131755297;
public static final int TestThemeWithLineHeight = 2131755298;
public static final int TestThemeWithLineHeightDisabled = 2131755299;
public static final int TextAppearance_AppCompat = 2131755300;
public static final int TextAppearance_AppCompat_Body1 = 2131755301;
public static final int TextAppearance_AppCompat_Body2 = 2131755302;
public static final int TextAppearance_AppCompat_Button = 2131755303;
public static final int TextAppearance_AppCompat_Caption = 2131755304;
public static final int TextAppearance_AppCompat_Display1 = 2131755305;
public static final int TextAppearance_AppCompat_Display2 = 2131755306;
public static final int TextAppearance_AppCompat_Display3 = 2131755307;
public static final int TextAppearance_AppCompat_Display4 = 2131755308;
public static final int TextAppearance_AppCompat_Headline = 2131755309;
public static final int TextAppearance_AppCompat_Inverse = 2131755310;
public static final int TextAppearance_AppCompat_Large = 2131755311;
public static final int TextAppearance_AppCompat_Large_Inverse = 2131755312;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131755313;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 2131755314;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131755315;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131755316;
public static final int TextAppearance_AppCompat_Medium = 2131755317;
public static final int TextAppearance_AppCompat_Medium_Inverse = 2131755318;
public static final int TextAppearance_AppCompat_Menu = 2131755319;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 2131755320;
public static final int TextAppearance_AppCompat_SearchResult_Title = 2131755321;
public static final int TextAppearance_AppCompat_Small = 2131755322;
public static final int TextAppearance_AppCompat_Small_Inverse = 2131755323;
public static final int TextAppearance_AppCompat_Subhead = 2131755324;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 2131755325;
public static final int TextAppearance_AppCompat_Title = 2131755326;
public static final int TextAppearance_AppCompat_Title_Inverse = 2131755327;
public static final int TextAppearance_AppCompat_Tooltip = 2131755328;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131755329;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131755330;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131755331;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131755332;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131755333;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131755334;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131755335;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131755336;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131755337;
public static final int TextAppearance_AppCompat_Widget_Button = 2131755338;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131755339;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 2131755340;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 2131755341;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 2131755342;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131755343;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131755344;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131755345;
public static final int TextAppearance_AppCompat_Widget_Switch = 2131755346;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131755347;
public static final int TextAppearance_Compat_Notification = 2131755348;
public static final int TextAppearance_Compat_Notification_Info = 2131755349;
public static final int TextAppearance_Compat_Notification_Line2 = 2131755350;
public static final int TextAppearance_Compat_Notification_Time = 2131755351;
public static final int TextAppearance_Compat_Notification_Title = 2131755352;
public static final int TextAppearance_Design_CollapsingToolbar_Expanded = 2131755353;
public static final int TextAppearance_Design_Counter = 2131755354;
public static final int TextAppearance_Design_Counter_Overflow = 2131755355;
public static final int TextAppearance_Design_Error = 2131755356;
public static final int TextAppearance_Design_HelperText = 2131755357;
public static final int TextAppearance_Design_Hint = 2131755358;
public static final int TextAppearance_Design_Snackbar_Message = 2131755359;
public static final int TextAppearance_Design_Tab = 2131755360;
public static final int TextAppearance_MaterialComponents_Badge = 2131755361;
public static final int TextAppearance_MaterialComponents_Body1 = 2131755362;
public static final int TextAppearance_MaterialComponents_Body2 = 2131755363;
public static final int TextAppearance_MaterialComponents_Button = 2131755364;
public static final int TextAppearance_MaterialComponents_Caption = 2131755365;
public static final int TextAppearance_MaterialComponents_Chip = 2131755366;
public static final int TextAppearance_MaterialComponents_Headline1 = 2131755367;
public static final int TextAppearance_MaterialComponents_Headline2 = 2131755368;
public static final int TextAppearance_MaterialComponents_Headline3 = 2131755369;
public static final int TextAppearance_MaterialComponents_Headline4 = 2131755370;
public static final int TextAppearance_MaterialComponents_Headline5 = 2131755371;
public static final int TextAppearance_MaterialComponents_Headline6 = 2131755372;
public static final int TextAppearance_MaterialComponents_Overline = 2131755373;
public static final int TextAppearance_MaterialComponents_Subtitle1 = 2131755374;
public static final int TextAppearance_MaterialComponents_Subtitle2 = 2131755375;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131755376;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131755377;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131755378;
public static final int Theme_AppCompat = 2131755379;
public static final int Theme_AppCompat_CompactMenu = 2131755380;
public static final int Theme_AppCompat_DayNight = 2131755381;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 2131755382;
public static final int Theme_AppCompat_DayNight_Dialog = 2131755383;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 2131755384;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131755385;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 2131755386;
public static final int Theme_AppCompat_DayNight_NoActionBar = 2131755387;
public static final int Theme_AppCompat_Dialog = 2131755388;
public static final int Theme_AppCompat_Dialog_Alert = 2131755389;
public static final int Theme_AppCompat_Dialog_MinWidth = 2131755390;
public static final int Theme_AppCompat_DialogWhenLarge = 2131755391;
public static final int Theme_AppCompat_Light = 2131755392;
public static final int Theme_AppCompat_Light_DarkActionBar = 2131755393;
public static final int Theme_AppCompat_Light_Dialog = 2131755394;
public static final int Theme_AppCompat_Light_Dialog_Alert = 2131755395;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 2131755396;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 2131755397;
public static final int Theme_AppCompat_Light_NoActionBar = 2131755398;
public static final int Theme_AppCompat_NoActionBar = 2131755399;
public static final int Theme_Design = 2131755400;
public static final int Theme_Design_BottomSheetDialog = 2131755401;
public static final int Theme_Design_Light = 2131755402;
public static final int Theme_Design_Light_BottomSheetDialog = 2131755403;
public static final int Theme_Design_Light_NoActionBar = 2131755404;
public static final int Theme_Design_NoActionBar = 2131755405;
public static final int Theme_MaterialComponents = 2131755406;
public static final int Theme_MaterialComponents_BottomSheetDialog = 2131755407;
public static final int Theme_MaterialComponents_Bridge = 2131755408;
public static final int Theme_MaterialComponents_CompactMenu = 2131755409;
public static final int Theme_MaterialComponents_DayNight = 2131755410;
public static final int Theme_MaterialComponents_DayNight_BottomSheetDialog = 2131755411;
public static final int Theme_MaterialComponents_DayNight_Bridge = 2131755412;
public static final int Theme_MaterialComponents_DayNight_DarkActionBar = 2131755413;
public static final int Theme_MaterialComponents_DayNight_DarkActionBar_Bridge = 2131755414;
public static final int Theme_MaterialComponents_DayNight_Dialog = 2131755415;
public static final int Theme_MaterialComponents_DayNight_Dialog_Alert = 2131755416;
public static final int Theme_MaterialComponents_DayNight_Dialog_Alert_Bridge = 2131755417;
public static final int Theme_MaterialComponents_DayNight_Dialog_Bridge = 2131755418;
public static final int Theme_MaterialComponents_DayNight_Dialog_FixedSize = 2131755419;
public static final int Theme_MaterialComponents_DayNight_Dialog_FixedSize_Bridge = 2131755420;
public static final int Theme_MaterialComponents_DayNight_Dialog_MinWidth = 2131755421;
public static final int Theme_MaterialComponents_DayNight_Dialog_MinWidth_Bridge = 2131755422;
public static final int Theme_MaterialComponents_DayNight_DialogWhenLarge = 2131755423;
public static final int Theme_MaterialComponents_DayNight_NoActionBar = 2131755424;
public static final int Theme_MaterialComponents_DayNight_NoActionBar_Bridge = 2131755425;
public static final int Theme_MaterialComponents_Dialog = 2131755426;
public static final int Theme_MaterialComponents_Dialog_Alert = 2131755427;
public static final int Theme_MaterialComponents_Dialog_Alert_Bridge = 2131755428;
public static final int Theme_MaterialComponents_Dialog_Bridge = 2131755429;
public static final int Theme_MaterialComponents_Dialog_FixedSize = 2131755430;
public static final int Theme_MaterialComponents_Dialog_FixedSize_Bridge = 2131755431;
public static final int Theme_MaterialComponents_Dialog_MinWidth = 2131755432;
public static final int Theme_MaterialComponents_Dialog_MinWidth_Bridge = 2131755433;
public static final int Theme_MaterialComponents_DialogWhenLarge = 2131755434;
public static final int Theme_MaterialComponents_Light = 2131755435;
public static final int Theme_MaterialComponents_Light_BarSize = 2131755436;
public static final int Theme_MaterialComponents_Light_BottomSheetDialog = 2131755437;
public static final int Theme_MaterialComponents_Light_Bridge = 2131755438;
public static final int Theme_MaterialComponents_Light_DarkActionBar = 2131755439;
public static final int Theme_MaterialComponents_Light_DarkActionBar_Bridge = 2131755440;
public static final int Theme_MaterialComponents_Light_Dialog = 2131755441;
public static final int Theme_MaterialComponents_Light_Dialog_Alert = 2131755442;
public static final int Theme_MaterialComponents_Light_Dialog_Alert_Bridge = 2131755443;
public static final int Theme_MaterialComponents_Light_Dialog_Bridge = 2131755444;
public static final int Theme_MaterialComponents_Light_Dialog_FixedSize = 2131755445;
public static final int Theme_MaterialComponents_Light_Dialog_FixedSize_Bridge = 2131755446;
public static final int Theme_MaterialComponents_Light_Dialog_MinWidth = 2131755447;
public static final int Theme_MaterialComponents_Light_Dialog_MinWidth_Bridge = 2131755448;
public static final int Theme_MaterialComponents_Light_DialogWhenLarge = 2131755449;
public static final int Theme_MaterialComponents_Light_LargeTouch = 2131755450;
public static final int Theme_MaterialComponents_Light_NoActionBar = 2131755451;
public static final int Theme_MaterialComponents_Light_NoActionBar_Bridge = 2131755452;
public static final int Theme_MaterialComponents_NoActionBar = 2131755453;
public static final int Theme_MaterialComponents_NoActionBar_Bridge = 2131755454;
public static final int Theme_MyApplicationTest = 2131755455;
public static final int ThemeOverlay_AppCompat = 2131755456;
public static final int ThemeOverlay_AppCompat_ActionBar = 2131755457;
public static final int ThemeOverlay_AppCompat_Dark = 2131755458;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 2131755459;
public static final int ThemeOverlay_AppCompat_DayNight = 2131755460;
public static final int ThemeOverlay_AppCompat_DayNight_ActionBar = 2131755461;
public static final int ThemeOverlay_AppCompat_Dialog = 2131755462;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 2131755463;
public static final int ThemeOverlay_AppCompat_Light = 2131755464;
public static final int ThemeOverlay_Design_TextInputEditText = 2131755465;
public static final int ThemeOverlay_MaterialComponents = 2131755466;
public static final int ThemeOverlay_MaterialComponents_ActionBar = 2131755467;
public static final int ThemeOverlay_MaterialComponents_ActionBar_Primary = 2131755468;
public static final int ThemeOverlay_MaterialComponents_ActionBar_Surface = 2131755469;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView = 2131755470;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_FilledBox = 2131755471;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_FilledBox_Dense = 2131755472;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_OutlinedBox = 2131755473;
public static final int ThemeOverlay_MaterialComponents_AutoCompleteTextView_OutlinedBox_Dense = 2131755474;
public static final int ThemeOverlay_MaterialComponents_BottomAppBar_Primary = 2131755475;
public static final int ThemeOverlay_MaterialComponents_BottomAppBar_Surface = 2131755476;
public static final int ThemeOverlay_MaterialComponents_BottomSheetDialog = 2131755477;
public static final int ThemeOverlay_MaterialComponents_Dark = 2131755478;
public static final int ThemeOverlay_MaterialComponents_Dark_ActionBar = 2131755479;
public static final int ThemeOverlay_MaterialComponents_DayNight_BottomSheetDialog = 2131755480;
public static final int ThemeOverlay_MaterialComponents_Dialog = 2131755481;
public static final int ThemeOverlay_MaterialComponents_Dialog_Alert = 2131755482;
public static final int ThemeOverlay_MaterialComponents_Light = 2131755483;
public static final int ThemeOverlay_MaterialComponents_Light_BottomSheetDialog = 2131755484;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog = 2131755485;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Centered = 2131755486;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date = 2131755487;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Calendar = 2131755488;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Header_Text = 2131755489;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Header_Text_Day = 2131755490;
public static final int ThemeOverlay_MaterialComponents_MaterialAlertDialog_Picker_Date_Spinner = 2131755491;
public static final int ThemeOverlay_MaterialComponents_MaterialCalendar = 2131755492;
public static final int ThemeOverlay_MaterialComponents_MaterialCalendar_Fullscreen = 2131755493;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText = 2131755494;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_FilledBox = 2131755495;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_FilledBox_Dense = 2131755496;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_OutlinedBox = 2131755497;
public static final int ThemeOverlay_MaterialComponents_TextInputEditText_OutlinedBox_Dense = 2131755498;
public static final int ThemeOverlay_MaterialComponents_Toolbar_Primary = 2131755499;
public static final int ThemeOverlay_MaterialComponents_Toolbar_Surface = 2131755500;
public static final int Widget_AppCompat_ActionBar = 2131755501;
public static final int Widget_AppCompat_ActionBar_Solid = 2131755502;
public static final int Widget_AppCompat_ActionBar_TabBar = 2131755503;
public static final int Widget_AppCompat_ActionBar_TabText = 2131755504;
public static final int Widget_AppCompat_ActionBar_TabView = 2131755505;
public static final int Widget_AppCompat_ActionButton = 2131755506;
public static final int Widget_AppCompat_ActionButton_CloseMode = 2131755507;
public static final int Widget_AppCompat_ActionButton_Overflow = 2131755508;
public static final int Widget_AppCompat_ActionMode = 2131755509;
public static final int Widget_AppCompat_ActivityChooserView = 2131755510;
public static final int Widget_AppCompat_AutoCompleteTextView = 2131755511;
public static final int Widget_AppCompat_Button = 2131755512;
public static final int Widget_AppCompat_Button_Borderless = 2131755513;
public static final int Widget_AppCompat_Button_Borderless_Colored = 2131755514;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131755515;
public static final int Widget_AppCompat_Button_Colored = 2131755516;
public static final int Widget_AppCompat_Button_Small = 2131755517;
public static final int Widget_AppCompat_ButtonBar = 2131755518;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 2131755519;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 2131755520;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 2131755521;
public static final int Widget_AppCompat_CompoundButton_Switch = 2131755522;
public static final int Widget_AppCompat_DrawerArrowToggle = 2131755523;
public static final int Widget_AppCompat_DropDownItem_Spinner = 2131755524;
public static final int Widget_AppCompat_EditText = 2131755525;
public static final int Widget_AppCompat_ImageButton = 2131755526;
public static final int Widget_AppCompat_Light_ActionBar = 2131755527;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 2131755528;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131755529;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 2131755530;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131755531;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 2131755532;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131755533;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 2131755534;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131755535;
public static final int Widget_AppCompat_Light_ActionButton = 2131755536;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 2131755537;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 2131755538;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 2131755539;
public static final int Widget_AppCompat_Light_ActivityChooserView = 2131755540;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 2131755541;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 2131755542;
public static final int Widget_AppCompat_Light_ListPopupWindow = 2131755543;
public static final int Widget_AppCompat_Light_ListView_DropDown = 2131755544;
public static final int Widget_AppCompat_Light_PopupMenu = 2131755545;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 2131755546;
public static final int Widget_AppCompat_Light_SearchView = 2131755547;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131755548;
public static final int Widget_AppCompat_ListMenuView = 2131755549;
public static final int Widget_AppCompat_ListPopupWindow = 2131755550;
public static final int Widget_AppCompat_ListView = 2131755551;
public static final int Widget_AppCompat_ListView_DropDown = 2131755552;
public static final int Widget_AppCompat_ListView_Menu = 2131755553;
public static final int Widget_AppCompat_PopupMenu = 2131755554;
public static final int Widget_AppCompat_PopupMenu_Overflow = 2131755555;
public static final int Widget_AppCompat_PopupWindow = 2131755556;
public static final int Widget_AppCompat_ProgressBar = 2131755557;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 2131755558;
public static final int Widget_AppCompat_RatingBar = 2131755559;
public static final int Widget_AppCompat_RatingBar_Indicator = 2131755560;
public static final int Widget_AppCompat_RatingBar_Small = 2131755561;
public static final int Widget_AppCompat_SearchView = 2131755562;
public static final int Widget_AppCompat_SearchView_ActionBar = 2131755563;
public static final int Widget_AppCompat_SeekBar = 2131755564;
public static final int Widget_AppCompat_SeekBar_Discrete = 2131755565;
public static final int Widget_AppCompat_Spinner = 2131755566;
public static final int Widget_AppCompat_Spinner_DropDown = 2131755567;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131755568;
public static final int Widget_AppCompat_Spinner_Underlined = 2131755569;
public static final int Widget_AppCompat_TextView = 2131755570;
public static final int Widget_AppCompat_TextView_SpinnerItem = 2131755571;
public static final int Widget_AppCompat_Toolbar = 2131755572;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 2131755573;
public static final int Widget_Compat_NotificationActionContainer = 2131755574;
public static final int Widget_Compat_NotificationActionText = 2131755575;
public static final int Widget_Design_AppBarLayout = 2131755576;
public static final int Widget_Design_BottomNavigationView = 2131755577;
public static final int Widget_Design_BottomSheet_Modal = 2131755578;
public static final int Widget_Design_CollapsingToolbar = 2131755579;
public static final int Widget_Design_FloatingActionButton = 2131755580;
public static final int Widget_Design_NavigationView = 2131755581;
public static final int Widget_Design_ScrimInsetsFrameLayout = 2131755582;
public static final int Widget_Design_Snackbar = 2131755583;
public static final int Widget_Design_TabLayout = 2131755584;
public static final int Widget_Design_TextInputLayout = 2131755585;
public static final int Widget_MaterialComponents_ActionBar_Primary = 2131755586;
public static final int Widget_MaterialComponents_ActionBar_PrimarySurface = 2131755587;
public static final int Widget_MaterialComponents_ActionBar_Solid = 2131755588;
public static final int Widget_MaterialComponents_ActionBar_Surface = 2131755589;
public static final int Widget_MaterialComponents_AppBarLayout_Primary = 2131755590;
public static final int Widget_MaterialComponents_AppBarLayout_PrimarySurface = 2131755591;
public static final int Widget_MaterialComponents_AppBarLayout_Surface = 2131755592;
public static final int Widget_MaterialComponents_AutoCompleteTextView_FilledBox = 2131755593;
public static final int Widget_MaterialComponents_AutoCompleteTextView_FilledBox_Dense = 2131755594;
public static final int Widget_MaterialComponents_AutoCompleteTextView_OutlinedBox = 2131755595;
public static final int Widget_MaterialComponents_AutoCompleteTextView_OutlinedBox_Dense = 2131755596;
public static final int Widget_MaterialComponents_Badge = 2131755597;
public static final int Widget_MaterialComponents_BottomAppBar = 2131755598;
public static final int Widget_MaterialComponents_BottomAppBar_Colored = 2131755599;
public static final int Widget_MaterialComponents_BottomAppBar_PrimarySurface = 2131755600;
public static final int Widget_MaterialComponents_BottomNavigationView = 2131755601;
public static final int Widget_MaterialComponents_BottomNavigationView_Colored = 2131755602;
public static final int Widget_MaterialComponents_BottomNavigationView_PrimarySurface = 2131755603;
public static final int Widget_MaterialComponents_BottomSheet = 2131755604;
public static final int Widget_MaterialComponents_BottomSheet_Modal = 2131755605;
public static final int Widget_MaterialComponents_Button = 2131755606;
public static final int Widget_MaterialComponents_Button_Icon = 2131755607;
public static final int Widget_MaterialComponents_Button_OutlinedButton = 2131755608;
public static final int Widget_MaterialComponents_Button_OutlinedButton_Icon = 2131755609;
public static final int Widget_MaterialComponents_Button_TextButton = 2131755610;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog = 2131755611;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog_Flush = 2131755612;
public static final int Widget_MaterialComponents_Button_TextButton_Dialog_Icon = 2131755613;
public static final int Widget_MaterialComponents_Button_TextButton_Icon = 2131755614;
public static final int Widget_MaterialComponents_Button_TextButton_Snackbar = 2131755615;
public static final int Widget_MaterialComponents_Button_UnelevatedButton = 2131755616;
public static final int Widget_MaterialComponents_Button_UnelevatedButton_Icon = 2131755617;
public static final int Widget_MaterialComponents_CardView = 2131755618;
public static final int Widget_MaterialComponents_CheckedTextView = 2131755619;
public static final int Widget_MaterialComponents_Chip_Action = 2131755620;
public static final int Widget_MaterialComponents_Chip_Choice = 2131755621;
public static final int Widget_MaterialComponents_Chip_Entry = 2131755622;
public static final int Widget_MaterialComponents_Chip_Filter = 2131755623;
public static final int Widget_MaterialComponents_ChipGroup = 2131755624;
public static final int Widget_MaterialComponents_CompoundButton_CheckBox = 2131755625;
public static final int Widget_MaterialComponents_CompoundButton_RadioButton = 2131755626;
public static final int Widget_MaterialComponents_CompoundButton_Switch = 2131755627;
public static final int Widget_MaterialComponents_ExtendedFloatingActionButton = 2131755628;
public static final int Widget_MaterialComponents_ExtendedFloatingActionButton_Icon = 2131755629;
public static final int Widget_MaterialComponents_FloatingActionButton = 2131755630;
public static final int Widget_MaterialComponents_Light_ActionBar_Solid = 2131755631;
public static final int Widget_MaterialComponents_MaterialButtonToggleGroup = 2131755632;
public static final int Widget_MaterialComponents_MaterialCalendar = 2131755633;
public static final int Widget_MaterialComponents_MaterialCalendar_Day = 2131755634;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Invalid = 2131755635;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Selected = 2131755636;
public static final int Widget_MaterialComponents_MaterialCalendar_Day_Today = 2131755637;
public static final int Widget_MaterialComponents_MaterialCalendar_DayTextView = 2131755638;
public static final int Widget_MaterialComponents_MaterialCalendar_Fullscreen = 2131755639;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderConfirmButton = 2131755640;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderDivider = 2131755641;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderLayout = 2131755642;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderSelection = 2131755643;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderSelection_Fullscreen = 2131755644;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderTitle = 2131755645;
public static final int Widget_MaterialComponents_MaterialCalendar_HeaderToggleButton = 2131755646;
public static final int Widget_MaterialComponents_MaterialCalendar_Item = 2131755647;
public static final int Widget_MaterialComponents_MaterialCalendar_Year = 2131755648;
public static final int Widget_MaterialComponents_MaterialCalendar_Year_Selected = 2131755649;
public static final int Widget_MaterialComponents_MaterialCalendar_Year_Today = 2131755650;
public static final int Widget_MaterialComponents_NavigationView = 2131755651;
public static final int Widget_MaterialComponents_PopupMenu = 2131755652;
public static final int Widget_MaterialComponents_PopupMenu_ContextMenu = 2131755653;
public static final int Widget_MaterialComponents_PopupMenu_ListPopupWindow = 2131755654;
public static final int Widget_MaterialComponents_PopupMenu_Overflow = 2131755655;
public static final int Widget_MaterialComponents_Snackbar = 2131755656;
public static final int Widget_MaterialComponents_Snackbar_FullWidth = 2131755657;
public static final int Widget_MaterialComponents_TabLayout = 2131755658;
public static final int Widget_MaterialComponents_TabLayout_Colored = 2131755659;
public static final int Widget_MaterialComponents_TabLayout_PrimarySurface = 2131755660;
public static final int Widget_MaterialComponents_TextInputEditText_FilledBox = 2131755661;
public static final int Widget_MaterialComponents_TextInputEditText_FilledBox_Dense = 2131755662;
public static final int Widget_MaterialComponents_TextInputEditText_OutlinedBox = 2131755663;
public static final int Widget_MaterialComponents_TextInputEditText_OutlinedBox_Dense = 2131755664;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox = 2131755665;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_Dense = 2131755666;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_Dense_ExposedDropdownMenu = 2131755667;
public static final int Widget_MaterialComponents_TextInputLayout_FilledBox_ExposedDropdownMenu = 2131755668;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox = 2131755669;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_Dense = 2131755670;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_Dense_ExposedDropdownMenu = 2131755671;
public static final int Widget_MaterialComponents_TextInputLayout_OutlinedBox_ExposedDropdownMenu = 2131755672;
public static final int Widget_MaterialComponents_TextView = 2131755673;
public static final int Widget_MaterialComponents_Toolbar = 2131755674;
public static final int Widget_MaterialComponents_Toolbar_Primary = 2131755675;
public static final int Widget_MaterialComponents_Toolbar_PrimarySurface = 2131755676;
public static final int Widget_MaterialComponents_Toolbar_Surface = 2131755677;
public static final int Widget_Support_CoordinatorLayout = 2131755678;
}
public static final class xml {
public static final int accessibility_service_config = 2131886080;
public static final int standalone_badge = 2131886081;
public static final int standalone_badge_gravity_bottom_end = 2131886082;
public static final int standalone_badge_gravity_bottom_start = 2131886083;
public static final int standalone_badge_gravity_top_start = 2131886084;
}
}
| 196,755 | 0.741187 | 0.606881 | 2,669 | 72.717499 | 15.735127 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.979393 | false | false | 14 |
58bbd37aa218dd0f605fdb88b6488d50095d8e0e | 23,081,154,287,849 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/ui/tools/CropImageView$a.java | cc4b1bc598db12ad30de6395bb6b2a898ce3fe05 | [] | no_license | jambestwick/HackWechat | https://github.com/jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446000 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | true | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | 2020-03-23T07:48:28 | 2018-02-02T05:34:08 | 27,006 | 0 | 0 | 0 | null | false | false | package com.tencent.mm.ui.tools;
public interface CropImageView$a {
void cxH();
}
| UTF-8 | Java | 87 | java | CropImageView$a.java | Java | [] | null | [] | package com.tencent.mm.ui.tools;
public interface CropImageView$a {
void cxH();
}
| 87 | 0.712644 | 0.712644 | 5 | 16.4 | 14.56846 | 34 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 14 |
bb5d03c8eb6cce3dce4421d34dcca7ac0ad66b1a | 25,769,803,817,226 | 8e7c349e8e6494ea722053744230d7c445fb5d24 | /src/main/java/nl/han/ica/oose/dea/presentation/controllers/Controller.java | 7ad9932ccdcd29e626b1ebe0404df39a3962d198 | [] | no_license | jilldinnissen93/Vodagone | https://github.com/jilldinnissen93/Vodagone | 79581f2df89b34568edf47674721674c03163a07 | 58bc380c1c22fa561f1b33690c8199c943329203 | refs/heads/master | 2023-03-05T13:47:47.966000 | 2021-02-17T11:22:58 | 2021-02-17T11:22:58 | 125,355,243 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nl.han.ica.oose.dea.presentation.controllers;
import nl.han.ica.oose.dea.dataAccess.DAO.AbonneeDAO;
import nl.han.ica.oose.dea.dataAccess.identityMaps.UserMapper;
import java.util.logging.Level;
import java.util.logging.Logger;
public abstract class Controller {
static final Logger logger = Logger.getLogger(AbonneeDAO.class.getName());
public int getLoggedInUser(String token){
int userId;
if (UserMapper.getUserMapper().findUserByToken(token).isPresent()) {
userId = UserMapper.getUserMapper().findUserByToken(token).get().getUserId();
} else {
logger.log(Level.FINE, "Unable to find user information.");
return -1;
}
return userId;
}
public boolean isUserId(int userId){
return userId != -1;
}
}
| UTF-8 | Java | 818 | java | Controller.java | Java | [] | null | [] | package nl.han.ica.oose.dea.presentation.controllers;
import nl.han.ica.oose.dea.dataAccess.DAO.AbonneeDAO;
import nl.han.ica.oose.dea.dataAccess.identityMaps.UserMapper;
import java.util.logging.Level;
import java.util.logging.Logger;
public abstract class Controller {
static final Logger logger = Logger.getLogger(AbonneeDAO.class.getName());
public int getLoggedInUser(String token){
int userId;
if (UserMapper.getUserMapper().findUserByToken(token).isPresent()) {
userId = UserMapper.getUserMapper().findUserByToken(token).get().getUserId();
} else {
logger.log(Level.FINE, "Unable to find user information.");
return -1;
}
return userId;
}
public boolean isUserId(int userId){
return userId != -1;
}
}
| 818 | 0.677262 | 0.674817 | 26 | 30.461538 | 27.365377 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 14 |
f8a81965a0c39c35bc16d8f1fb20b66a3d52e263 | 27,874,337,788,843 | db148483a10e05c28c5a1d4cf82ed48f41113244 | /Medical Store/src/froms/UpdateStock.java | cd43bf47ad149f4d91c850471c04ea60576cac1a | [] | no_license | shahroz14/Medical-Store | https://github.com/shahroz14/Medical-Store | 287160129d6e4fc8fc50b6c7181b2d785aa44ef9 | 6d219a4089e46f6434dcba5c9657e17e00fb5f44 | refs/heads/master | 2020-12-24T07:53:46.429000 | 2016-11-10T07:43:00 | 2016-11-10T07:43:00 | 73,357,817 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package froms;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class UpdateStock extends JPanel implements ActionListener, KeyListener {
JComboBox medNameCombo;
JTextField rateTF;
JLabel amountLabel;
JTextField qtyTF;
JTextField amountTF;
JButton update;
public UpdateStock() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, SQLException {
super();
setLayout(new GridBagLayout());
GridBagConstraints g = new GridBagConstraints();
//Misc.
Font label = new Font("Verdana", Font.PLAIN, 13);
Font tF = new Font("Calibri", Font.PLAIN, 13);
Font head = new Font("Verdana", Font.BOLD, 15);
Insets headGap = new Insets(30, 10, 10, 10);
Insets body = new Insets(10,10,10,10);
JLabel heading = new JLabel("Update Medicine");
heading.setFont(head);
g=AddNewMedicine.constraints(g, 0, 0, GridBagConstraints.REMAINDER, 1, GridBagConstraints.CENTER, 0, 0, 0);
add(heading,g);
JLabel medNameLabel = new JLabel("Medicine Name :");
medNameLabel.setFont(label);
g=AddNewMedicine.constraints(g, 0, 1, 1, 1, GridBagConstraints.WEST, 0, 10, 0);
g.insets = headGap;
add(medNameLabel,g);
//Medicine[] medNames = UpdateStock.getMedicineNames();
medNameCombo = new AutoCompleteComboBox(UpdateStock.getMedicineNames());
medNameCombo.setFont(label);
g=AddNewMedicine.constraints(g, 1, 1, 1, 1, GridBagConstraints.WEST, 0, 60, 0);
add(medNameCombo,g);
medNameCombo.addActionListener(this);
JLabel rateLabel = new JLabel("Rate :");
rateLabel.setFont(label);
g.insets=body;
g=AddNewMedicine.constraints(g, 0, 2, 1, 1, GridBagConstraints.WEST, 0, 20, 0);
add(rateLabel,g);
rateTF = new JTextField(6);
rateTF.setFont(tF);
g.insets=body;
g=AddNewMedicine.constraints(g, 1, 2, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(rateTF,g);
rateTF.addActionListener(this);
JLabel qtyLabel = new JLabel("Quantity :");
qtyLabel.setFont(label);
g.insets=body;
g=AddNewMedicine.constraints(g, 0, 3, 1, 1, GridBagConstraints.WEST, 0, 20, 0);
add(qtyLabel,g);
qtyTF = new JTextField(6);
qtyTF.setFont(tF);
g.insets=body;
g=AddNewMedicine.constraints(g, 1, 3, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(qtyTF,g);
qtyTF.addKeyListener(this);
qtyTF.addActionListener(this);
amountLabel = new JLabel("Amount :");
amountLabel.setFont(label);
g=AddNewMedicine.constraints(g, 0, 4, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(amountLabel,g);
amountTF = new JTextField(7);
amountTF.setFont(tF);
g=AddNewMedicine.constraints(g, 1, 4, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
amountTF.setEditable(false);
add(amountTF,g);
update = new JButton("Update");
update.setFont(label);
g.insets = headGap;
g=AddNewMedicine.constraints(g, 1, 5, 1, 1, GridBagConstraints.EAST, 0, 0, 0);
add(update,g);
update.addActionListener(this);
setVisible(true);
setSize(800, 600);
}
static public Medicine[] getMedicineNames() throws ClassNotFoundException, SQLException {
Connection conn = getDatabaseConnection();
PreparedStatement pS = conn.prepareStatement("select Med_Name, Med_Rate, Stock_Available, Amount from medicine_stock;");
ResultSet rS = pS.executeQuery();
int count =0;
while(rS.next()){
count++;
}
Medicine medNames[] = new Medicine[count];
count=0;
rS.beforeFirst();
while(rS.next()){
medNames[count] = new Medicine();
medNames[count].medName = rS.getString(1);
medNames[count].rate = rS.getFloat(2);
medNames[count].quantity = rS.getInt(3);
medNames[count].amount = rS.getFloat(4);
Calendar date = Calendar.getInstance();
Date time = date.getTime();
SimpleDateFormat datePrint = new SimpleDateFormat("dd/MM/yyyy");
medNames[count].date = datePrint.format(time);
count++;
}
rS.close();
conn.close();
return medNames;
}
static Connection getDatabaseConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/Medical_Store_Management_System?user=root");
return conn;
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(medNameCombo)){
try{
Medicine med = (Medicine)medNameCombo.getSelectedItem();
try {
med = updateComboBox(med);
} catch (SQLException e1) {
e1.printStackTrace();
} catch (ClassNotFoundException e1) {
e1.printStackTrace();
}
rateTF.setText(""+med.rate);
qtyTF.setText(""+med.quantity);
float amount = (Float.parseFloat(rateTF.getText()))*(Integer.parseInt(qtyTF.getText()));
amountTF.setText(""+amount);
}
catch (ClassCastException e1) {
JOptionPane.showMessageDialog(this, "Medicine not found!", "Caution", JOptionPane.ERROR_MESSAGE, null);
e1.printStackTrace();
}
}
if(e.getSource().equals(qtyTF)||e.getSource().equals(rateTF)){
float amount = (Float.parseFloat(rateTF.getText()))*(Integer.parseInt(qtyTF.getText()));
amountTF.setText(""+amount);
}
if(e.getSource().equals(update)){
try {
updateMedicine(medNameCombo.getSelectedItem());
JOptionPane.showMessageDialog(this, "Update Successfully", "Done", JOptionPane.INFORMATION_MESSAGE,null);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
private Medicine updateComboBox(Medicine med) throws SQLException, ClassNotFoundException {
Connection conn = getDatabaseConnection();
PreparedStatement pS = conn.prepareStatement("select Med_Name, Med_Rate, Stock_Available, Amount from medicine_stock WHERE Med_Name=?;");
pS.setString(1, med.medName);
ResultSet rS = pS.executeQuery();
rS.next();
med.rate = rS.getFloat(2);
med.quantity = rS.getInt(3);
med.amount = rS.getFloat(4);
return med;
}
@Override
public void keyPressed(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent e) {
if(e.getSource().equals(qtyTF)){
char c = e.getKeyChar();
if(!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE))){
e.setKeyChar('\0');
}
}
}
private void updateMedicine(Object selectedItem) throws SQLException, ClassNotFoundException {
Medicine med = (Medicine)selectedItem;
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/Medical_Store_Management_System?user=root");
PreparedStatement pS = conn.prepareStatement("UPDATE medicine_stock SET Stock_Available=?, Amount=?, Med_Rate=? WHERE Med_Name=?;");
float rate = Float.parseFloat(rateTF.getText());
int qty = Integer.parseInt(qtyTF.getText());
float amt = rate*qty;
pS.setInt(1, qty);
pS.setFloat(2, amt);
pS.setFloat(3, rate);
pS.setString(4, med.medName);
pS.executeUpdate();
pS.close();
conn.close();
}
}
class Medicine{
String date;
String medName;
Float rate;
Integer quantity;
Float amount;
public String toString() {
return this.medName;
}
}
| UTF-8 | Java | 8,294 | java | UpdateStock.java | Java | [] | null | [] | package froms;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class UpdateStock extends JPanel implements ActionListener, KeyListener {
JComboBox medNameCombo;
JTextField rateTF;
JLabel amountLabel;
JTextField qtyTF;
JTextField amountTF;
JButton update;
public UpdateStock() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, SQLException {
super();
setLayout(new GridBagLayout());
GridBagConstraints g = new GridBagConstraints();
//Misc.
Font label = new Font("Verdana", Font.PLAIN, 13);
Font tF = new Font("Calibri", Font.PLAIN, 13);
Font head = new Font("Verdana", Font.BOLD, 15);
Insets headGap = new Insets(30, 10, 10, 10);
Insets body = new Insets(10,10,10,10);
JLabel heading = new JLabel("Update Medicine");
heading.setFont(head);
g=AddNewMedicine.constraints(g, 0, 0, GridBagConstraints.REMAINDER, 1, GridBagConstraints.CENTER, 0, 0, 0);
add(heading,g);
JLabel medNameLabel = new JLabel("Medicine Name :");
medNameLabel.setFont(label);
g=AddNewMedicine.constraints(g, 0, 1, 1, 1, GridBagConstraints.WEST, 0, 10, 0);
g.insets = headGap;
add(medNameLabel,g);
//Medicine[] medNames = UpdateStock.getMedicineNames();
medNameCombo = new AutoCompleteComboBox(UpdateStock.getMedicineNames());
medNameCombo.setFont(label);
g=AddNewMedicine.constraints(g, 1, 1, 1, 1, GridBagConstraints.WEST, 0, 60, 0);
add(medNameCombo,g);
medNameCombo.addActionListener(this);
JLabel rateLabel = new JLabel("Rate :");
rateLabel.setFont(label);
g.insets=body;
g=AddNewMedicine.constraints(g, 0, 2, 1, 1, GridBagConstraints.WEST, 0, 20, 0);
add(rateLabel,g);
rateTF = new JTextField(6);
rateTF.setFont(tF);
g.insets=body;
g=AddNewMedicine.constraints(g, 1, 2, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(rateTF,g);
rateTF.addActionListener(this);
JLabel qtyLabel = new JLabel("Quantity :");
qtyLabel.setFont(label);
g.insets=body;
g=AddNewMedicine.constraints(g, 0, 3, 1, 1, GridBagConstraints.WEST, 0, 20, 0);
add(qtyLabel,g);
qtyTF = new JTextField(6);
qtyTF.setFont(tF);
g.insets=body;
g=AddNewMedicine.constraints(g, 1, 3, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(qtyTF,g);
qtyTF.addKeyListener(this);
qtyTF.addActionListener(this);
amountLabel = new JLabel("Amount :");
amountLabel.setFont(label);
g=AddNewMedicine.constraints(g, 0, 4, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
add(amountLabel,g);
amountTF = new JTextField(7);
amountTF.setFont(tF);
g=AddNewMedicine.constraints(g, 1, 4, 1, 1, GridBagConstraints.WEST, 0, 0, 0);
amountTF.setEditable(false);
add(amountTF,g);
update = new JButton("Update");
update.setFont(label);
g.insets = headGap;
g=AddNewMedicine.constraints(g, 1, 5, 1, 1, GridBagConstraints.EAST, 0, 0, 0);
add(update,g);
update.addActionListener(this);
setVisible(true);
setSize(800, 600);
}
static public Medicine[] getMedicineNames() throws ClassNotFoundException, SQLException {
Connection conn = getDatabaseConnection();
PreparedStatement pS = conn.prepareStatement("select Med_Name, Med_Rate, Stock_Available, Amount from medicine_stock;");
ResultSet rS = pS.executeQuery();
int count =0;
while(rS.next()){
count++;
}
Medicine medNames[] = new Medicine[count];
count=0;
rS.beforeFirst();
while(rS.next()){
medNames[count] = new Medicine();
medNames[count].medName = rS.getString(1);
medNames[count].rate = rS.getFloat(2);
medNames[count].quantity = rS.getInt(3);
medNames[count].amount = rS.getFloat(4);
Calendar date = Calendar.getInstance();
Date time = date.getTime();
SimpleDateFormat datePrint = new SimpleDateFormat("dd/MM/yyyy");
medNames[count].date = datePrint.format(time);
count++;
}
rS.close();
conn.close();
return medNames;
}
static Connection getDatabaseConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/Medical_Store_Management_System?user=root");
return conn;
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(medNameCombo)){
try{
Medicine med = (Medicine)medNameCombo.getSelectedItem();
try {
med = updateComboBox(med);
} catch (SQLException e1) {
e1.printStackTrace();
} catch (ClassNotFoundException e1) {
e1.printStackTrace();
}
rateTF.setText(""+med.rate);
qtyTF.setText(""+med.quantity);
float amount = (Float.parseFloat(rateTF.getText()))*(Integer.parseInt(qtyTF.getText()));
amountTF.setText(""+amount);
}
catch (ClassCastException e1) {
JOptionPane.showMessageDialog(this, "Medicine not found!", "Caution", JOptionPane.ERROR_MESSAGE, null);
e1.printStackTrace();
}
}
if(e.getSource().equals(qtyTF)||e.getSource().equals(rateTF)){
float amount = (Float.parseFloat(rateTF.getText()))*(Integer.parseInt(qtyTF.getText()));
amountTF.setText(""+amount);
}
if(e.getSource().equals(update)){
try {
updateMedicine(medNameCombo.getSelectedItem());
JOptionPane.showMessageDialog(this, "Update Successfully", "Done", JOptionPane.INFORMATION_MESSAGE,null);
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
private Medicine updateComboBox(Medicine med) throws SQLException, ClassNotFoundException {
Connection conn = getDatabaseConnection();
PreparedStatement pS = conn.prepareStatement("select Med_Name, Med_Rate, Stock_Available, Amount from medicine_stock WHERE Med_Name=?;");
pS.setString(1, med.medName);
ResultSet rS = pS.executeQuery();
rS.next();
med.rate = rS.getFloat(2);
med.quantity = rS.getInt(3);
med.amount = rS.getFloat(4);
return med;
}
@Override
public void keyPressed(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent e) {
if(e.getSource().equals(qtyTF)){
char c = e.getKeyChar();
if(!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE))){
e.setKeyChar('\0');
}
}
}
private void updateMedicine(Object selectedItem) throws SQLException, ClassNotFoundException {
Medicine med = (Medicine)selectedItem;
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/Medical_Store_Management_System?user=root");
PreparedStatement pS = conn.prepareStatement("UPDATE medicine_stock SET Stock_Available=?, Amount=?, Med_Rate=? WHERE Med_Name=?;");
float rate = Float.parseFloat(rateTF.getText());
int qty = Integer.parseInt(qtyTF.getText());
float amt = rate*qty;
pS.setInt(1, qty);
pS.setFloat(2, amt);
pS.setFloat(3, rate);
pS.setString(4, med.medName);
pS.executeUpdate();
pS.close();
conn.close();
}
}
class Medicine{
String date;
String medName;
Float rate;
Integer quantity;
Float amount;
public String toString() {
return this.medName;
}
}
| 8,294 | 0.683144 | 0.667109 | 274 | 28.270073 | 28.045584 | 148 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.978102 | false | false | 14 |
21c1832830c7c9d149e8435697751532f0dca693 | 7,267,084,698,626 | c2251dc41989e4c831be87b48e772ef7734016f9 | /Decode.java | 983142cb5f7e9266db67038193c6cc3e024fb0d3 | [] | no_license | vincetran/Move-to-Front-Encode-Decode | https://github.com/vincetran/Move-to-Front-Encode-Decode | fbdd00f81cb0ced2515c3605bfd309c8b30f337d | 2a40e6ab948e0ea613420ea6597bd05ff25ff8b1 | refs/heads/master | 2020-05-16T23:56:11.283000 | 2011-08-31T13:09:20 | 2011-08-31T13:09:20 | 2,301,476 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | //Vincent Tran
//CS 1501
//Will perform Move to Front transform on ASCII characters
//Format: java Decode inputfilename.extension
//Tested files: .bin
import java.lang.*;
import java.util.*;
import java.io.*;
public class Decode
{
public static void main(String [] args) throws IOException
{
ArrayList<Integer> data = new ArrayList<Integer>();
int[] dict = new int[256];
for(int i = 0; i < 256; i++)
dict[i] = i;
//Will read each character from the input file and store into an ArrayList
Scanner br = new Scanner(new File(args[0]));
while(br.hasNext())
{
data.add(br.nextInt());
}
int index=0;
String output = "";
//Performs the Move-To-Front transform on the ArrayList
for(int dataVal : data)
{
char b = (char)dict[dataVal];
for(int check = dataVal; check != 0; check--)
{
dict[check] = dict[check-1];
}
dict[0] = b;
output = output+ b;
}
//Prints out the decoded message onto the console
System.out.println(output);
}
} | UTF-8 | Java | 995 | java | Decode.java | Java | [
{
"context": "//Vincent Tran\n//CS 1501\n//Will perform Move to Front transform ",
"end": 14,
"score": 0.9997576475143433,
"start": 2,
"tag": "NAME",
"value": "Vincent Tran"
}
] | null | [] | //<NAME>
//CS 1501
//Will perform Move to Front transform on ASCII characters
//Format: java Decode inputfilename.extension
//Tested files: .bin
import java.lang.*;
import java.util.*;
import java.io.*;
public class Decode
{
public static void main(String [] args) throws IOException
{
ArrayList<Integer> data = new ArrayList<Integer>();
int[] dict = new int[256];
for(int i = 0; i < 256; i++)
dict[i] = i;
//Will read each character from the input file and store into an ArrayList
Scanner br = new Scanner(new File(args[0]));
while(br.hasNext())
{
data.add(br.nextInt());
}
int index=0;
String output = "";
//Performs the Move-To-Front transform on the ArrayList
for(int dataVal : data)
{
char b = (char)dict[dataVal];
for(int check = dataVal; check != 0; check--)
{
dict[check] = dict[check-1];
}
dict[0] = b;
output = output+ b;
}
//Prints out the decoded message onto the console
System.out.println(output);
}
} | 989 | 0.651256 | 0.635176 | 44 | 21.636364 | 19.748522 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false | 14 |
88b8c77954560625067c9908f251beac657977f7 | 1,606,317,813,534 | 66ce44ddc0533fad27cb4b5a669932c6ea1370e6 | /Android/MyPos/app/src/main/java/wikets/mypos/GenerarPdf.java | 8c39f92cdf7561391503ef3695102c488a901f47 | [] | no_license | erinaldo/SisVen | https://github.com/erinaldo/SisVen | 07f5f7556aca8aea72f23d1eeca9665e4946e6b7 | f48fe2405e5aa690bb11a618a3d1661f63ed70ce | refs/heads/master | 2023-08-10T12:59:36.883000 | 2021-09-14T23:29:18 | 2021-09-14T23:29:18 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package wikets.mypos;
/**
* Created by Miguel on 03/05/2018.
*/
import harmony.java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.HeaderFooter;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.ColumnText;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.pdf.draw.LineSeparator;
public class GenerarPdf extends Activity implements OnClickListener {
private final int REQUEST_CODE_ASK_PERMISSIONS = 123;
private final static String NOMBRE_DIRECTORIO = "MiPdf";
private final static String NOMBRE_DOCUMENTO = "listado_precios.pdf";
private final static String ETIQUETA_ERROR = "ERROR";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViewById(R.id.btnGenerar).setOnClickListener(this);
VerificarPermisos();
}
@Override
public void onClick(View v) {
Document documento = new Document();
try {
// Creamos el fichero con el nombre que deseemos.
File f = crearFichero(NOMBRE_DOCUMENTO);
FileOutputStream ficheroPdf = new FileOutputStream(
f.getAbsolutePath());
PdfWriter writer = PdfWriter.getInstance(documento, ficheroPdf);
// Incluimos el píe de página y una cabecera
HeaderFooter cabecera = new HeaderFooter(new Phrase(
"Esta es mi cabecera"), false);
HeaderFooter pie = new HeaderFooter(new Phrase(
"Este es mi pie de página"), false);
documento.setHeader(cabecera);
documento.setFooter(pie);
documento.open();
// Añadimos un título con la fuente por defecto.
documento.add(new Paragraph("Título 1"));
// Añadimos un título con una fuente personalizada.
Font font = FontFactory.getFont(FontFactory.HELVETICA, 28,
Font.BOLD, Color.RED);
documento.add(new Paragraph("Título personalizado", font));
// Insertamos una imagen que se encuentra en los recursos de la
// aplicación.
Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(),R.drawable.icon);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
Image imagen = Image.getInstance(stream.toByteArray());
documento.add(imagen);
Phrase frase = new Phrase("Ejemplo de iText - El lado oscuro de java ");
documento.add(frase);
LineSeparator ls = new LineSeparator();
documento.add(new Chunk(ls));
// Insertamos una tabla.
PdfPTable tabla = new PdfPTable(5);
for (int i = 0; i < 15; i++) {
tabla.addCell("Celda " + i);
}
documento.add(tabla);
// Agregar marca de agua
font = FontFactory.getFont(FontFactory.HELVETICA, 42, Font.BOLD,
Color.GRAY);
ColumnText.showTextAligned(writer.getDirectContentUnder(),
Element.ALIGN_CENTER, new Paragraph(
"Jorge Antonio Parra Parra", font), 297.5f, 421,
writer.getPageNumber() % 2 == 1 ? 45 : -45);
} catch (DocumentException e) {
Log.e(ETIQUETA_ERROR, e.getMessage());
} catch (IOException e) {
Log.e(ETIQUETA_ERROR, e.getMessage());
} finally {
// Cerramos el documento.
documento.close();
}
}
public static File crearFichero(String nombreFichero) throws IOException {
File ruta = getRuta();
File fichero = null;
if (ruta != null)
fichero = new File(ruta, nombreFichero);
return fichero;
}
public static File getRuta() {
File ruta = null;
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState())) {
ruta = new File(
Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
NOMBRE_DIRECTORIO);
if (ruta != null) {
if (!ruta.mkdirs()) {
if (!ruta.exists()) {
return null;
}
}
}
} else {
}
return ruta;
}
private void VerificarPermisos() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
//Toast.makeText(this, "This version is not Android 6 or later " + Build.VERSION.SDK_INT, Toast.LENGTH_LONG).show();
} else {
int hasWriteContactsPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWriteContactsPermission != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE},
REQUEST_CODE_ASK_PERMISSIONS);
//Toast.makeText(this, "Requesting permissions", Toast.LENGTH_LONG).show();
}else if (hasWriteContactsPermission == PackageManager.PERMISSION_GRANTED){
//Toast.makeText(this, "The permissions are already granted ", Toast.LENGTH_LONG).show();
}
}
return;
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if(REQUEST_CODE_ASK_PERMISSIONS == requestCode) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
{
Toast.makeText(this, "Permisos Otorgados!", Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(this, "Permisos Denegados!", Toast.LENGTH_LONG).show();
}
}else{
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
} | UTF-8 | Java | 6,867 | java | GenerarPdf.java | Java | [
{
"context": "package wikets.mypos;\n\n/**\n * Created by Miguel on 03/05/2018.\n */\n\nimport harmony.java.awt.Color",
"end": 47,
"score": 0.9996686577796936,
"start": 41,
"tag": "NAME",
"value": "Miguel"
},
{
"context": "NTER, new Paragraph(\n \"Jorge Ant... | null | [] | package wikets.mypos;
/**
* Created by Miguel on 03/05/2018.
*/
import harmony.java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.HeaderFooter;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.ColumnText;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.pdf.draw.LineSeparator;
public class GenerarPdf extends Activity implements OnClickListener {
private final int REQUEST_CODE_ASK_PERMISSIONS = 123;
private final static String NOMBRE_DIRECTORIO = "MiPdf";
private final static String NOMBRE_DOCUMENTO = "listado_precios.pdf";
private final static String ETIQUETA_ERROR = "ERROR";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViewById(R.id.btnGenerar).setOnClickListener(this);
VerificarPermisos();
}
@Override
public void onClick(View v) {
Document documento = new Document();
try {
// Creamos el fichero con el nombre que deseemos.
File f = crearFichero(NOMBRE_DOCUMENTO);
FileOutputStream ficheroPdf = new FileOutputStream(
f.getAbsolutePath());
PdfWriter writer = PdfWriter.getInstance(documento, ficheroPdf);
// Incluimos el píe de página y una cabecera
HeaderFooter cabecera = new HeaderFooter(new Phrase(
"Esta es mi cabecera"), false);
HeaderFooter pie = new HeaderFooter(new Phrase(
"Este es mi pie de página"), false);
documento.setHeader(cabecera);
documento.setFooter(pie);
documento.open();
// Añadimos un título con la fuente por defecto.
documento.add(new Paragraph("Título 1"));
// Añadimos un título con una fuente personalizada.
Font font = FontFactory.getFont(FontFactory.HELVETICA, 28,
Font.BOLD, Color.RED);
documento.add(new Paragraph("Título personalizado", font));
// Insertamos una imagen que se encuentra en los recursos de la
// aplicación.
Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(),R.drawable.icon);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
Image imagen = Image.getInstance(stream.toByteArray());
documento.add(imagen);
Phrase frase = new Phrase("Ejemplo de iText - El lado oscuro de java ");
documento.add(frase);
LineSeparator ls = new LineSeparator();
documento.add(new Chunk(ls));
// Insertamos una tabla.
PdfPTable tabla = new PdfPTable(5);
for (int i = 0; i < 15; i++) {
tabla.addCell("Celda " + i);
}
documento.add(tabla);
// Agregar marca de agua
font = FontFactory.getFont(FontFactory.HELVETICA, 42, Font.BOLD,
Color.GRAY);
ColumnText.showTextAligned(writer.getDirectContentUnder(),
Element.ALIGN_CENTER, new Paragraph(
"<NAME>", font), 297.5f, 421,
writer.getPageNumber() % 2 == 1 ? 45 : -45);
} catch (DocumentException e) {
Log.e(ETIQUETA_ERROR, e.getMessage());
} catch (IOException e) {
Log.e(ETIQUETA_ERROR, e.getMessage());
} finally {
// Cerramos el documento.
documento.close();
}
}
public static File crearFichero(String nombreFichero) throws IOException {
File ruta = getRuta();
File fichero = null;
if (ruta != null)
fichero = new File(ruta, nombreFichero);
return fichero;
}
public static File getRuta() {
File ruta = null;
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState())) {
ruta = new File(
Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
NOMBRE_DIRECTORIO);
if (ruta != null) {
if (!ruta.mkdirs()) {
if (!ruta.exists()) {
return null;
}
}
}
} else {
}
return ruta;
}
private void VerificarPermisos() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
//Toast.makeText(this, "This version is not Android 6 or later " + Build.VERSION.SDK_INT, Toast.LENGTH_LONG).show();
} else {
int hasWriteContactsPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWriteContactsPermission != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE},
REQUEST_CODE_ASK_PERMISSIONS);
//Toast.makeText(this, "Requesting permissions", Toast.LENGTH_LONG).show();
}else if (hasWriteContactsPermission == PackageManager.PERMISSION_GRANTED){
//Toast.makeText(this, "The permissions are already granted ", Toast.LENGTH_LONG).show();
}
}
return;
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if(REQUEST_CODE_ASK_PERMISSIONS == requestCode) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
{
Toast.makeText(this, "Permisos Otorgados!", Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(this, "Permisos Denegados!", Toast.LENGTH_LONG).show();
}
}else{
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
} | 6,848 | 0.613534 | 0.607992 | 199 | 33.462311 | 27.901791 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.633166 | false | false | 14 |
329110410a2932e5c0c125ce34f183b61302c9d0 | 1,322,849,980,337 | aed25f011e668347bf70968f4fbd44b2e061be4b | /src/main/java/com/juaracoding/batch8ujian/repository/ReportDataRepository.java | 0d550d2a1c13df13bc14b9f24bc6730fb719c73e | [] | no_license | nip001/webaccessreport-ujianBatch8 | https://github.com/nip001/webaccessreport-ujianBatch8 | cbf5183511cdb68bd0daa9a9c1c8025c5bd89ce5 | c194fb7369c5c16c37fa0775c05edbe2759dbd07 | refs/heads/master | 2023-04-15T12:49:34.540000 | 2021-04-20T04:51:56 | 2021-04-20T04:51:56 | 359,336,367 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.juaracoding.batch8ujian.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import com.juaracoding.batch8ujian.entity.ReportData;
public interface ReportDataRepository extends CrudRepository<ReportData, Long>{
@Query(value = "select * from reportdata where status is not null",nativeQuery=true)
public List<ReportData> findStatusResponse();
@Query(value = "select * from reportdata where status is null",nativeQuery=true)
public List<ReportData> findStatusNull();
}
| UTF-8 | Java | 585 | java | ReportDataRepository.java | Java | [] | null | [] | package com.juaracoding.batch8ujian.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import com.juaracoding.batch8ujian.entity.ReportData;
public interface ReportDataRepository extends CrudRepository<ReportData, Long>{
@Query(value = "select * from reportdata where status is not null",nativeQuery=true)
public List<ReportData> findStatusResponse();
@Query(value = "select * from reportdata where status is null",nativeQuery=true)
public List<ReportData> findStatusNull();
}
| 585 | 0.810256 | 0.806838 | 16 | 35.5625 | 31.15078 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.875 | false | false | 14 |
a2f63ce3b9d12db002e39e5e8ba26cce4621159e | 10,479,720,243,154 | 7f3e82ce2bfbd8d89cba46293916168d18e1c79b | /org.xtext.example.fuzzyLanguage/src/user_interface/Main_class.java | 9c40dd66ceabab4624d91131b4732eaf908c18a5 | [] | no_license | cormakdlb/FuzzyFrameworkMetaModel | https://github.com/cormakdlb/FuzzyFrameworkMetaModel | eac8d6d643feaa504c79dc87e2c16ced78e8f49f | ec92d6764b922219be4c302aaad0a828e1d8e60a | refs/heads/master | 2022-06-15T11:43:20.327000 | 2020-05-05T15:23:54 | 2020-05-05T15:23:54 | 260,897,188 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package user_interface;
import org.apache.log4j.chainsaw.Main;
import ui.AbstractDocument;
import ui.AbstractView;
public class Main_class {
private AbstractView view;
private AbstractDocument document;
public Main_class() {
document = new CompilerDocument ();
view = new CompilerView (document);
document.setView(view);
}
public static void main (String argv []) {
Main_class app = new Main_class();
app.show();
}
public void show () {
view.setVisible(true);
}
} | UTF-8 | Java | 503 | java | Main_class.java | Java | [] | null | [] | package user_interface;
import org.apache.log4j.chainsaw.Main;
import ui.AbstractDocument;
import ui.AbstractView;
public class Main_class {
private AbstractView view;
private AbstractDocument document;
public Main_class() {
document = new CompilerDocument ();
view = new CompilerView (document);
document.setView(view);
}
public static void main (String argv []) {
Main_class app = new Main_class();
app.show();
}
public void show () {
view.setVisible(true);
}
} | 503 | 0.697813 | 0.695825 | 26 | 18.384615 | 14.754601 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.153846 | false | false | 14 |
02154bd8c9e7b289fd1d9eef02d60fa86639c898 | 1,675,037,302,250 | 9996b87badcb0861cd4a9097984a790361d320b0 | /src/test/java/com/woniu/zuoye2019_12_6/Test6.java | ffe01487f33133990e22000322da886d34f5e840 | [] | no_license | yaozhiwen234/spring2019 | https://github.com/yaozhiwen234/spring2019 | 76d0f210a102596a841a785c9844d5615034589d | 5b5b904113451b03cf2192d84f6576a3c03d1faf | refs/heads/master | 2020-09-29T12:47:11.761000 | 2020-02-05T05:39:49 | 2020-02-05T05:39:49 | 227,041,005 | 0 | 0 | null | false | 2020-07-02T01:34:54 | 2019-12-10T06:03:02 | 2020-02-05T05:40:31 | 2020-07-02T01:34:52 | 177 | 0 | 0 | 1 | Java | false | false | package com.woniu.zuoye2019_12_6;
/*6. 创建3个线程,分别不停地打印A、B、C。 要求保证打印的结果是:
ABCCBAABCCBAABCCBAABCCBA.....*/
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
class Bazs {
public int a = 0;
public int b = 1;
}
class Bar1 implements Runnable {
private Bazs baz;
public Bar1(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 0) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("A");
baz.a += baz.b;
if (baz.a == -1) {
baz.b = -baz.b;
baz.a += baz.b;
}
}
}
}
}
class Bar2 implements Runnable {
private Bazs baz;
public Bar2(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 1) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("B");
baz.a += baz.b;
}
}
}
}
class Bar3 implements Runnable {
private Bazs baz;
public Bar3(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 2) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("C");
baz.a += baz.b;
if (baz.a == 3) {
baz.b = -baz.b;
baz.a += baz.b;
}
}
}
}
}
public class Test6 {
public static void main(String[] args) {
ExecutorService threadPool = Executors.newCachedThreadPool();
Bazs baz = new Bazs();
threadPool.submit(new Bar1(baz));
threadPool.submit(new Bar2(baz));
threadPool.submit(new Bar3(baz));
}
}
| GB18030 | Java | 2,150 | java | Test6.java | Java | [] | null | [] | package com.woniu.zuoye2019_12_6;
/*6. 创建3个线程,分别不停地打印A、B、C。 要求保证打印的结果是:
ABCCBAABCCBAABCCBAABCCBA.....*/
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
class Bazs {
public int a = 0;
public int b = 1;
}
class Bar1 implements Runnable {
private Bazs baz;
public Bar1(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 0) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("A");
baz.a += baz.b;
if (baz.a == -1) {
baz.b = -baz.b;
baz.a += baz.b;
}
}
}
}
}
class Bar2 implements Runnable {
private Bazs baz;
public Bar2(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 1) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("B");
baz.a += baz.b;
}
}
}
}
class Bar3 implements Runnable {
private Bazs baz;
public Bar3(Bazs baz) {
this.baz = baz;
}
@Override
public void run() {
while (true) {
synchronized (baz) {
while (baz.a != 2) {
try {
baz.notifyAll();
baz.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("C");
baz.a += baz.b;
if (baz.a == 3) {
baz.b = -baz.b;
baz.a += baz.b;
}
}
}
}
}
public class Test6 {
public static void main(String[] args) {
ExecutorService threadPool = Executors.newCachedThreadPool();
Bazs baz = new Bazs();
threadPool.submit(new Bar1(baz));
threadPool.submit(new Bar2(baz));
threadPool.submit(new Bar3(baz));
}
}
| 2,150 | 0.541508 | 0.529103 | 125 | 14.768 | 13.634742 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.432 | false | false | 14 |
109815215f83243dbbef72e27a6a8ed9903328a7 | 4,363,686,810,600 | 961895ca763511833f92dd049bdf1452d6cf49d3 | /src/main/java/com/cognizant/pharmaWeb/repositories/MedicalLoginRepository.java | 16d88b5e4c112e390d53472976e568f468e22096 | [] | no_license | takalkarakash/project1 | https://github.com/takalkarakash/project1 | 5587819eaaed13b7cbad84de3b877fc9bc3a1f98 | 2d6f9b298724b157a9c57a96b6b0ba2a0192fcde | refs/heads/master | 2021-05-22T13:24:36.530000 | 2020-04-07T18:34:29 | 2020-04-07T18:34:29 | 252,945,881 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cognizant.pharmaWeb.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import com.cognizant.pharmaWeb.entities.MedicalLogin;
public interface MedicalLoginRepository extends JpaRepository<MedicalLogin,String> {
}
| UTF-8 | Java | 253 | java | MedicalLoginRepository.java | Java | [] | null | [] | package com.cognizant.pharmaWeb.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import com.cognizant.pharmaWeb.entities.MedicalLogin;
public interface MedicalLoginRepository extends JpaRepository<MedicalLogin,String> {
}
| 253 | 0.853755 | 0.853755 | 9 | 27.111111 | 31.61731 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 14 |
eea344c2dd8e6838184b7d4688ba7813eb556805 | 27,960,237,153,165 | 6e6e5324f7060c202c4482c84caf93c23ec99c8f | /java/objectclass/src/com/ustglobal/objectClass/Mouse.java | 756e2488b64c06e5ef1c42b37c9cad8f4927b163 | [] | no_license | Rehan-007/USTGlobal-16sept-19-anwar-rehan | https://github.com/Rehan-007/USTGlobal-16sept-19-anwar-rehan | f68a447f49f0577f60c1679a9d7296b08bd01bb3 | 7beb4f93fc880bc752313286f2dd23ebd11016a3 | refs/heads/master | 2023-01-11T18:59:10.545000 | 2019-12-22T03:57:08 | 2019-12-22T03:57:08 | 215,536,631 | 0 | 0 | null | false | 2023-01-07T13:03:10 | 2019-10-16T11:56:14 | 2019-12-22T03:57:25 | 2023-01-07T13:03:10 | 88,676 | 0 | 0 | 156 | Java | false | false | package com.ustglobal.objectClass;
public class Mouse {
void scroll() {
System.out.println("Mouse Scroll method");
}
void click() {
System.out.println("Mouse Click method");
}
}
| UTF-8 | Java | 190 | java | Mouse.java | Java | [] | null | [] | package com.ustglobal.objectClass;
public class Mouse {
void scroll() {
System.out.println("Mouse Scroll method");
}
void click() {
System.out.println("Mouse Click method");
}
}
| 190 | 0.684211 | 0.684211 | 12 | 14.833333 | 16.308655 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 14 |
67f15f30d7183ce7bc00a68bae63e067f7724ce5 | 4,518,305,639,586 | 5262e6a8a3ebff614bd075e212ed8e4687c2c430 | /src/musicPlayerModule/EmbeddedAudioPlayer.java | dad4207464f46ffc2b930b6b4a76eab925ddc050 | [] | no_license | D6Digital/SWENGFrame | https://github.com/D6Digital/SWENGFrame | 5da1e161aa7f48f5895ee573047bde97c90b2d24 | 4bd53d36948decb8d408e0217939d2669bad2fcd | refs/heads/master | 2016-09-09T21:13:13.967000 | 2014-06-11T14:20:34 | 2014-06-11T14:20:34 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package musicPlayerModule;
import java.awt.Canvas;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.Timer;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.player.MediaPlayerFactory;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
import uk.co.caprica.vlcj.player.embedded.videosurface.CanvasVideoSurface;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
/**
* A class which can be used to play pieces of audio headlessly.
* Providing methods to prepare and play audio, with various options.
* JPanel must be retrieved using getPanel() and plaed on a frame
* before the audio player features can be utilised...
* NOTE: In order to prevent unnecessary CPU usage when the
* use of EmbeddedAudioPlayer is no longer required it is strongly
* advised that the threadKill() method is called. This method
* will release the player, destroy the thread and return true if
* the thread has been correctly destroyed.
* @author Joshua Lant
* @author samPick
*
*/
public class EmbeddedAudioPlayer {
String vlcLibraryPath;
protected EmbeddedMediaPlayer mediaPlayer;
JPanel returnPanel = new JPanel();
String incomingChangeMessage = "";
private Boolean loopingGlobal = false;
private Boolean startedAllreadyGlobal = false;
private Boolean isPausedGlobal = false;
private String playingPathGlobal;
private Integer startTimeGlobal, endTimeGlobal = null;
private Integer pauseTime = 0;
private Thread musicThread;
private Timer theTimer;
/**
* Constructor for headless media player. Used to generate the media player with
* vlc previously loaded outside the EmbeddedAudioPlayer class.
*/
public EmbeddedAudioPlayer() {
// loop which looks for changes in audio.
musicThread = new Thread("Socket") {
public void run() {
while (true) {
musicPlayerLoop();
}
}
};
Canvas canvas = new Canvas();
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
mediaPlayer.setVideoSurface(videoSurface);
returnPanel.add(canvas);
returnPanel.setBounds(0, 0, 0, 0);
musicThread.start();
}
/**
* Constructor for media player. Used to load vlc from supplied library path
* and then generate media player.
*/
public EmbeddedAudioPlayer(String vlcLibraryPath) {
// loop which looks for changes in audio.
musicThread = new Thread("Socket") {
public void run() {
while (true) {
musicPlayerLoop();
}
}
};
this.vlcLibraryPath = vlcLibraryPath;
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),vlcLibraryPath);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
Canvas canvas = new Canvas();
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
mediaPlayer.setVideoSurface(videoSurface);
canvas.setBounds(0,0,0,0);
returnPanel.add(canvas);
returnPanel.setBounds(0, 0, 0, 0);
musicThread.start();
}
/**
* destroys the thread and releases the media player. If new audio is required
* after this a new EmbeddedAudioPlayer must be instantiated.
*/
public void threadKill() {
if(theTimer != null){
theTimer.stop();
}
musicThread = null;
mediaPlayer.release();
}
/**
* Stops the media, and when play resumes it will be from the beginning
* of the file, or at the point where start time was defined (if supplied)
*/
public void stopMedia() {
if(theTimer != null)
{
theTimer.stop();
}
startedAllreadyGlobal = false;
startTimeGlobal = 0;
isPausedGlobal = false;
endTimeGlobal = 0;
mediaPlayer.stop();
}
/**
* Plays a new piece of media, from the start of the track.
* @param mediaPathAndFileName - path to the file to play.
*/
public void playMedia(String mediaPathAndFileName) {
playingPathGlobal = mediaPathAndFileName;
isPausedGlobal = false;
playMedia();
}
/**
* Play whatever media has been prepared. (old values are kept for start and end times.)
* If media is paused currently then media will begin playing from point in track
* at which it was paused.
*/
public void playMedia() {
if(isPausedGlobal) {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + pauseTime, ":stop-time=" + endTimeGlobal);
}
else {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + startTimeGlobal, ":stop-time=" + endTimeGlobal);
}
isPausedGlobal = false;
startTimer();
}
public boolean isPlaying() {
return mediaPlayer.isPlaying();
}
/**
* Starts the timer, used to poll for changes in the audio,
* and to give feedback about timing information.
*/
private void startTimer() {
int delay = 200; // 200ms or 0.2 second timer
ActionListener taskPerformer= new ActionListener() {
int x = 0;
@Override
public void actionPerformed(ActionEvent e) {
x = setStartedAllready(x);
}
};
theTimer = new Timer(delay, taskPerformer);
theTimer.setInitialDelay(0);
theTimer.start();
}
/**
* Pauses the media, time remains at point where it was paused.
* This method cannot be used to initiate playback. once paused
* the playMedia() method must be called, at which point the audio will
* be unpaused.
*/
public void pauseMedia() {
if(!isPausedGlobal) {
isPausedGlobal = true;
mediaPlayer.pause();
pauseTime = (int) this.getCurrentPositionSeconds();
}
}
/**
* Get the panel upon which the media player is seated. Panel
* must be retrieved and placed upon a frame for media to playback.
* otherwise vlcj exceptions will be thrown.
* @return JPanel containing media player.
*/
public JPanel getPanel() {
return returnPanel;
}
/**
* Get the length of the track in milliseconds.
* @return long track length
*/
public long getLengthMS() {
return mediaPlayer.getLength()/1000;
}
/**
* Gets the track length in format String MM:SS
* @return
*/
public String getTrackLength() {
long seconds = mediaPlayer.getLength()/1000 % 60;
int minutes = (int) (mediaPlayer.getLength()/1000/60);
return minutes + ":" + seconds;
}
/**
* Gets the number of seconds in the track length,
* not total but "SS" from track length "MM:SS".
* @return
*/
public long getSeconds() {
return mediaPlayer.getLength()/1000 % 60;
}
/**
* Gets the number of monites of the track length,
* not total floating point but "MM" from track length "MM:SS".
* @return
*/
public int getMinutes() {
return (int) (mediaPlayer.getLength()/1000/60);
}
/**
* returns the total track length in seconds.
* @return
*/
public long getTotalLengthInSeconds() {
return mediaPlayer.getLength()/1000;
}
/**
* Gets the current position of playback,
* in format MM:SS.
* @return
*/
public String getCurrentPosition() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
int minutes = (int) (position/60);
int seconds = (int) (position % 60);
return minutes + ":" + seconds;
}
/**
* Gets the current position of playback minutes,
* ie, gets "MM" in "MM:SS".
* @return
*/
public int getCurrentPositionMinutes() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
return (int) (position/60);
}
/**
* Gets the current position of playback seconds,
* ie, gets "SS" in "MM:SS".
* @return
*/
public long getCurrentPositionSeconds() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
return (long) (position % 60);
}
/**
* Set the start time in seconds of the audio playback.
* @param startTimeSeconds
*/
public void setStartTime(int startTimeSeconds) {
mediaPlayer.setTime(startTimeSeconds*1000);
startTimeGlobal = startTimeSeconds;
}
/**
* set the stop time in seconds of the audio playback.
* @param endTimeSeconds
*/
public void setEndTime(int endTimeSeconds) {
endTimeGlobal = endTimeSeconds;
}
/**
* Get the number of seconds remaining in the track.
* @return
*/
public long getSecondsRemaining() {
return this.getTotalLengthInSeconds() - this.getCurrentPositionMinutes()*60 - this.getCurrentPositionSeconds();
}
/**
* Get the total time remiaining in track, in format "MM:SS"
* @return
*/
public String getTimeRemaining() {
long seconds = getSecondsRemaining() % 60;
int minutes = (int) (getSecondsRemaining()/60);
return minutes + ":" + seconds;
}
/**
* @param loopTrueFalse- true for looping, false for play once.
*/
public void setLooping(Boolean loopTrueFalse) {
loopingGlobal = loopTrueFalse;
}
/**
* Gets status of whether or not the audio is looping.
* @return
*/
public Boolean getLooping() {
return loopingGlobal;
}
/**
* Set the volume between 0 and 100. Values above or below
* will not be accepted and the old value of volume will remain.
* @param percentage
*/
public void setVolumePercentage(int percentage) {
if((percentage <= 100) && (percentage >= 0)) {
mediaPlayer.setVolume(percentage);
}
else {
System.err.println("Cannot supply a volume below 0 or above 100");
}
}
/**
* The music player loop used in the Thread. Begins the timer to check whether audio is playing
* if the media is stopped, looping is on, the track has been played before and the media is
* not paused.
*/
private void musicPlayerLoop() {
if(!mediaPlayer.isPlaying() && loopingGlobal && startedAllreadyGlobal && !isPausedGlobal) {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + startTimeGlobal, ":stop-time=" + endTimeGlobal);
startTimer();
}
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
*/
public void prepareMedia(String filePathURL, int startTimeSeconds) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds);
playingPathGlobal = filePathURL;
startTimeGlobal = startTimeSeconds;
endTimeGlobal = 0;
loopingGlobal = false;
isPausedGlobal = false;
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param endTimeSeconds
*/
public void prepareMedia(String filePathURL, int startTimeSeconds, int endTimeSeconds) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + endTimeSeconds);
playingPathGlobal = filePathURL;
startTimeGlobal = startTimeSeconds;
endTimeGlobal = endTimeSeconds;
loopingGlobal = false;
isPausedGlobal = false;
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param endTimeSeconds
* @param looping
*/
public void prepareMedia(String filePathURL, int startTimeSeconds, int endTimeSeconds, Boolean looping) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + endTimeSeconds);
loopingGlobal = looping;
playingPathGlobal = filePathURL;
isPausedGlobal = false;
if(startTimeSeconds == 0){
startTimeGlobal = null;
}
else {
startTimeGlobal = startTimeSeconds;
}
if(endTimeSeconds == 0) {
endTimeGlobal = null;
}
else {
endTimeGlobal = endTimeSeconds;
}
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start time and duration.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param durationSeconds
* @param looping
*/
public void prepareMediaWithDuration(String filePathURL, int startTimeSeconds, int durationSeconds, Boolean looping) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + (startTimeSeconds + durationSeconds));
loopingGlobal = looping;
playingPathGlobal = filePathURL;
isPausedGlobal = false;
if(startTimeSeconds == 0){
startTimeGlobal = null;
}
else {
startTimeGlobal = startTimeSeconds;
}
if((startTimeSeconds + durationSeconds) == 0) {
endTimeGlobal = null;
}
else {
endTimeGlobal = (startTimeSeconds + durationSeconds);
}
startedAllreadyGlobal = false;
}
/**
* Checks to see whether the audio starts correctly when it is meant to. If not an error message
* is returned. If yes then the media goes into the corresponding state to say it has started and
* is playing.
* @param x
* @return
*/
private int setStartedAllready(int x) {
Boolean mediaStarted = false;
mediaStarted = mediaPlayer.isPlaying();
if(mediaStarted) {
startedAllreadyGlobal = true;
theTimer.stop();
}
x = x + 200;
if(x > 5000 && mediaStarted == false){
System.err.println("Media not started after 5 seconds,");
theTimer.stop();
}
return x;
}
}
| UTF-8 | Java | 16,106 | java | EmbeddedAudioPlayer.java | Java | [
{
"context": "e thread has been correctly destroyed.\r\n * @author Joshua Lant\r\n * @author samPick\r\n *\r\n */\r\npublic class Embedd",
"end": 1134,
"score": 0.9998718500137329,
"start": 1123,
"tag": "NAME",
"value": "Joshua Lant"
},
{
"context": "tly destroyed.\r\n * @author Josh... | null | [] | package musicPlayerModule;
import java.awt.Canvas;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.Timer;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.player.MediaPlayerFactory;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
import uk.co.caprica.vlcj.player.embedded.videosurface.CanvasVideoSurface;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
/**
* A class which can be used to play pieces of audio headlessly.
* Providing methods to prepare and play audio, with various options.
* JPanel must be retrieved using getPanel() and plaed on a frame
* before the audio player features can be utilised...
* NOTE: In order to prevent unnecessary CPU usage when the
* use of EmbeddedAudioPlayer is no longer required it is strongly
* advised that the threadKill() method is called. This method
* will release the player, destroy the thread and return true if
* the thread has been correctly destroyed.
* @author <NAME>
* @author samPick
*
*/
public class EmbeddedAudioPlayer {
String vlcLibraryPath;
protected EmbeddedMediaPlayer mediaPlayer;
JPanel returnPanel = new JPanel();
String incomingChangeMessage = "";
private Boolean loopingGlobal = false;
private Boolean startedAllreadyGlobal = false;
private Boolean isPausedGlobal = false;
private String playingPathGlobal;
private Integer startTimeGlobal, endTimeGlobal = null;
private Integer pauseTime = 0;
private Thread musicThread;
private Timer theTimer;
/**
* Constructor for headless media player. Used to generate the media player with
* vlc previously loaded outside the EmbeddedAudioPlayer class.
*/
public EmbeddedAudioPlayer() {
// loop which looks for changes in audio.
musicThread = new Thread("Socket") {
public void run() {
while (true) {
musicPlayerLoop();
}
}
};
Canvas canvas = new Canvas();
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
mediaPlayer.setVideoSurface(videoSurface);
returnPanel.add(canvas);
returnPanel.setBounds(0, 0, 0, 0);
musicThread.start();
}
/**
* Constructor for media player. Used to load vlc from supplied library path
* and then generate media player.
*/
public EmbeddedAudioPlayer(String vlcLibraryPath) {
// loop which looks for changes in audio.
musicThread = new Thread("Socket") {
public void run() {
while (true) {
musicPlayerLoop();
}
}
};
this.vlcLibraryPath = vlcLibraryPath;
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),vlcLibraryPath);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
Canvas canvas = new Canvas();
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
mediaPlayer.setVideoSurface(videoSurface);
canvas.setBounds(0,0,0,0);
returnPanel.add(canvas);
returnPanel.setBounds(0, 0, 0, 0);
musicThread.start();
}
/**
* destroys the thread and releases the media player. If new audio is required
* after this a new EmbeddedAudioPlayer must be instantiated.
*/
public void threadKill() {
if(theTimer != null){
theTimer.stop();
}
musicThread = null;
mediaPlayer.release();
}
/**
* Stops the media, and when play resumes it will be from the beginning
* of the file, or at the point where start time was defined (if supplied)
*/
public void stopMedia() {
if(theTimer != null)
{
theTimer.stop();
}
startedAllreadyGlobal = false;
startTimeGlobal = 0;
isPausedGlobal = false;
endTimeGlobal = 0;
mediaPlayer.stop();
}
/**
* Plays a new piece of media, from the start of the track.
* @param mediaPathAndFileName - path to the file to play.
*/
public void playMedia(String mediaPathAndFileName) {
playingPathGlobal = mediaPathAndFileName;
isPausedGlobal = false;
playMedia();
}
/**
* Play whatever media has been prepared. (old values are kept for start and end times.)
* If media is paused currently then media will begin playing from point in track
* at which it was paused.
*/
public void playMedia() {
if(isPausedGlobal) {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + pauseTime, ":stop-time=" + endTimeGlobal);
}
else {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + startTimeGlobal, ":stop-time=" + endTimeGlobal);
}
isPausedGlobal = false;
startTimer();
}
public boolean isPlaying() {
return mediaPlayer.isPlaying();
}
/**
* Starts the timer, used to poll for changes in the audio,
* and to give feedback about timing information.
*/
private void startTimer() {
int delay = 200; // 200ms or 0.2 second timer
ActionListener taskPerformer= new ActionListener() {
int x = 0;
@Override
public void actionPerformed(ActionEvent e) {
x = setStartedAllready(x);
}
};
theTimer = new Timer(delay, taskPerformer);
theTimer.setInitialDelay(0);
theTimer.start();
}
/**
* Pauses the media, time remains at point where it was paused.
* This method cannot be used to initiate playback. once paused
* the playMedia() method must be called, at which point the audio will
* be unpaused.
*/
public void pauseMedia() {
if(!isPausedGlobal) {
isPausedGlobal = true;
mediaPlayer.pause();
pauseTime = (int) this.getCurrentPositionSeconds();
}
}
/**
* Get the panel upon which the media player is seated. Panel
* must be retrieved and placed upon a frame for media to playback.
* otherwise vlcj exceptions will be thrown.
* @return JPanel containing media player.
*/
public JPanel getPanel() {
return returnPanel;
}
/**
* Get the length of the track in milliseconds.
* @return long track length
*/
public long getLengthMS() {
return mediaPlayer.getLength()/1000;
}
/**
* Gets the track length in format String MM:SS
* @return
*/
public String getTrackLength() {
long seconds = mediaPlayer.getLength()/1000 % 60;
int minutes = (int) (mediaPlayer.getLength()/1000/60);
return minutes + ":" + seconds;
}
/**
* Gets the number of seconds in the track length,
* not total but "SS" from track length "MM:SS".
* @return
*/
public long getSeconds() {
return mediaPlayer.getLength()/1000 % 60;
}
/**
* Gets the number of monites of the track length,
* not total floating point but "MM" from track length "MM:SS".
* @return
*/
public int getMinutes() {
return (int) (mediaPlayer.getLength()/1000/60);
}
/**
* returns the total track length in seconds.
* @return
*/
public long getTotalLengthInSeconds() {
return mediaPlayer.getLength()/1000;
}
/**
* Gets the current position of playback,
* in format MM:SS.
* @return
*/
public String getCurrentPosition() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
int minutes = (int) (position/60);
int seconds = (int) (position % 60);
return minutes + ":" + seconds;
}
/**
* Gets the current position of playback minutes,
* ie, gets "MM" in "MM:SS".
* @return
*/
public int getCurrentPositionMinutes() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
return (int) (position/60);
}
/**
* Gets the current position of playback seconds,
* ie, gets "SS" in "MM:SS".
* @return
*/
public long getCurrentPositionSeconds() {
long totalLength = getTotalLengthInSeconds();
float currentPosition = mediaPlayer.getPosition();
float position = currentPosition*totalLength;
return (long) (position % 60);
}
/**
* Set the start time in seconds of the audio playback.
* @param startTimeSeconds
*/
public void setStartTime(int startTimeSeconds) {
mediaPlayer.setTime(startTimeSeconds*1000);
startTimeGlobal = startTimeSeconds;
}
/**
* set the stop time in seconds of the audio playback.
* @param endTimeSeconds
*/
public void setEndTime(int endTimeSeconds) {
endTimeGlobal = endTimeSeconds;
}
/**
* Get the number of seconds remaining in the track.
* @return
*/
public long getSecondsRemaining() {
return this.getTotalLengthInSeconds() - this.getCurrentPositionMinutes()*60 - this.getCurrentPositionSeconds();
}
/**
* Get the total time remiaining in track, in format "MM:SS"
* @return
*/
public String getTimeRemaining() {
long seconds = getSecondsRemaining() % 60;
int minutes = (int) (getSecondsRemaining()/60);
return minutes + ":" + seconds;
}
/**
* @param loopTrueFalse- true for looping, false for play once.
*/
public void setLooping(Boolean loopTrueFalse) {
loopingGlobal = loopTrueFalse;
}
/**
* Gets status of whether or not the audio is looping.
* @return
*/
public Boolean getLooping() {
return loopingGlobal;
}
/**
* Set the volume between 0 and 100. Values above or below
* will not be accepted and the old value of volume will remain.
* @param percentage
*/
public void setVolumePercentage(int percentage) {
if((percentage <= 100) && (percentage >= 0)) {
mediaPlayer.setVolume(percentage);
}
else {
System.err.println("Cannot supply a volume below 0 or above 100");
}
}
/**
* The music player loop used in the Thread. Begins the timer to check whether audio is playing
* if the media is stopped, looping is on, the track has been played before and the media is
* not paused.
*/
private void musicPlayerLoop() {
if(!mediaPlayer.isPlaying() && loopingGlobal && startedAllreadyGlobal && !isPausedGlobal) {
mediaPlayer.playMedia(playingPathGlobal, ":start-time=" + startTimeGlobal, ":stop-time=" + endTimeGlobal);
startTimer();
}
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
*/
public void prepareMedia(String filePathURL, int startTimeSeconds) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds);
playingPathGlobal = filePathURL;
startTimeGlobal = startTimeSeconds;
endTimeGlobal = 0;
loopingGlobal = false;
isPausedGlobal = false;
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param endTimeSeconds
*/
public void prepareMedia(String filePathURL, int startTimeSeconds, int endTimeSeconds) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + endTimeSeconds);
playingPathGlobal = filePathURL;
startTimeGlobal = startTimeSeconds;
endTimeGlobal = endTimeSeconds;
loopingGlobal = false;
isPausedGlobal = false;
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start and end times.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param endTimeSeconds
* @param looping
*/
public void prepareMedia(String filePathURL, int startTimeSeconds, int endTimeSeconds, Boolean looping) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + endTimeSeconds);
loopingGlobal = looping;
playingPathGlobal = filePathURL;
isPausedGlobal = false;
if(startTimeSeconds == 0){
startTimeGlobal = null;
}
else {
startTimeGlobal = startTimeSeconds;
}
if(endTimeSeconds == 0) {
endTimeGlobal = null;
}
else {
endTimeGlobal = endTimeSeconds;
}
startedAllreadyGlobal = false;
}
/**
* Prepares media for playback, simply call playMedia(void) method after calling this method to
* playback files with altered start time and duration.
* @param filePathURL - path or URL and filename to media
* @param startTimeSeconds
* @param durationSeconds
* @param looping
*/
public void prepareMediaWithDuration(String filePathURL, int startTimeSeconds, int durationSeconds, Boolean looping) {
mediaPlayer.prepareMedia(filePathURL, ":start-time=" + startTimeSeconds, ":stop-time=" + (startTimeSeconds + durationSeconds));
loopingGlobal = looping;
playingPathGlobal = filePathURL;
isPausedGlobal = false;
if(startTimeSeconds == 0){
startTimeGlobal = null;
}
else {
startTimeGlobal = startTimeSeconds;
}
if((startTimeSeconds + durationSeconds) == 0) {
endTimeGlobal = null;
}
else {
endTimeGlobal = (startTimeSeconds + durationSeconds);
}
startedAllreadyGlobal = false;
}
/**
* Checks to see whether the audio starts correctly when it is meant to. If not an error message
* is returned. If yes then the media goes into the corresponding state to say it has started and
* is playing.
* @param x
* @return
*/
private int setStartedAllready(int x) {
Boolean mediaStarted = false;
mediaStarted = mediaPlayer.isPlaying();
if(mediaStarted) {
startedAllreadyGlobal = true;
theTimer.stop();
}
x = x + 200;
if(x > 5000 && mediaStarted == false){
System.err.println("Media not started after 5 seconds,");
theTimer.stop();
}
return x;
}
}
| 16,101 | 0.609649 | 0.60344 | 476 | 31.831932 | 27.239544 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.451681 | false | false | 14 |
649bc405cc929f37cc01f85618d1cb3f665f3731 | 20,392,504,758,121 | 8fcf168430ed0c5aff8c017d6e923870ae002209 | /InvestmentReport/src/com/manticore/report/ChartPanel.java | 38f78c8afec8ca19ab459b843594cde542e7b1bc | [] | no_license | BackupTheBerlios/manticore | https://github.com/BackupTheBerlios/manticore | 82cf68019c987f7ba13b5d74e430f51df6a996e3 | d7a3c03c55d655a60ef917e92369335abcf258bd | refs/heads/master | 2021-01-22T01:04:31.476000 | 2010-11-29T11:30:21 | 2010-11-29T11:30:21 | 39,849,896 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
*
* Copyright (C) 2010 Andreas Reichel <andreas@manticore-projects.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
package com.manticore.report;
import com.manticore.util.Settings;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.TreeSet;
import java.util.Vector;
import javax.swing.JPanel;
import org.joda.time.DurationFieldType;
abstract class ChartPanel extends JPanel implements MouseMotionListener, ComponentListener {
public TreeSet<DataPoint> dataPointVector;
public TreeSet<DataPoint> dataPointVector2;
public final static int inset = 12;
public final static int gridlines = 5;
public final static DurationFieldType durationFieldType = DurationFieldType.days();
private int chartMode = LINE;
public String title;
public boolean showDataPointCaption=false;
public final static int LINE = 0;
public final static int BAR = 1;
public BufferedImage bufferedImage = null;
public DecimalFormat decimalFormat;
public Vector<String> stringVector;
public ChartPanel() {
this.title = "";
dataPointVector = new TreeSet<DataPoint>();
dataPointVector2 = new TreeSet<DataPoint>();
decimalFormat = (DecimalFormat) DecimalFormat.getInstance();
decimalFormat.setMaximumFractionDigits(2);
decimalFormat.setMinimumFractionDigits(2);
decimalFormat.setGroupingUsed(true);
addComponentListener(this);
stringVector=new Vector<String>();
}
public ChartPanel(String title) {
this.title = title;
dataPointVector = new TreeSet<DataPoint>();
decimalFormat = (DecimalFormat) DecimalFormat.getInstance();
decimalFormat.setMaximumFractionDigits(2);
decimalFormat.setMinimumFractionDigits(2);
decimalFormat.setGroupingUsed(true);
addComponentListener(this);
stringVector=new Vector<String>();
}
public void addData(String key, Float value) {
CategoryDataPoint dataPoint = new CategoryDataPoint(key, value);
dataPointVector.add(dataPoint);
}
public void addData(long key, Float value) {
TimeDataPoint dataPoint = new TimeDataPoint(new Date(key), value);
dataPointVector.add(dataPoint);
}
public void addData(int key, Float value) {
SlotDataPoint dataPoint = new SlotDataPoint(key, value);
dataPointVector.add(dataPoint);
}
public void addData2(int key, Float value) {
SlotDataPoint dataPoint = new SlotDataPoint(key, value);
dataPointVector2.add(dataPoint);
}
public abstract ChartObject getChartObject();
public void drawPlotObjects(Graphics2D g2D, ChartObject chartObject, float dx, float dy) {
for (int i = 0; i < chartObject.dataPoints.length; i++) {
if (chartObject.dataPoints[i] != null) {
drawBar(g2D, i, dx, chartObject.offset, dy, chartObject.dataPoints[i].value);
}
}
}
public void drawChart() {
if (bufferedImage == null && this.getGraphicsConfiguration() != null) {
bufferedImage = this.getGraphicsConfiguration().createCompatibleImage(getWidth(), getHeight());
}
if (bufferedImage != null) {
Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
g2D.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
g2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g2D.setColor(Color.WHITE);
g2D.fillRect(0, 0, getWidth(), getHeight());
ChartObject chartObject = getChartObject();
float dx = (float) (getWidth() - 2 * inset) / (float) chartObject.gridLinesCount;
float dy = ((float) (getHeight() - 2 * inset)) / (chartObject.range);
g2D.setColor(Settings.MANTICORE_DARK_GREY);
for (int i = 0; i < gridlines; i++) {
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy));
g2D.drawString(decimalFormat.format(chartObject.dy2*i), inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy);
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy));
g2D.drawString(decimalFormat.format(-chartObject.dy2*i), inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy);
}
for (int i = 0; i < chartObject.gridLinesCount; i++) {
g2D.draw(new Line2D.Float(inset + i * dx + dx / 2, inset, inset + i * dx + dx / 2, getHeight() - inset));
}
dx = (float) (getWidth() - 2 * inset) / (float) chartObject.dataPoints.length;
dy = ((float) (getHeight() - 2 * inset)) / chartObject.range;
//draw average if exists
if (chartObject.average != 0f) {
g2D.setColor(Settings.MANTICORE_ORANGE);
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset - chartObject.average) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset - chartObject.average) * dy));
}
drawPlotObjects(g2D, chartObject, dx, dy);
if (title.length() > 0) {
g2D.setFont(Settings.MEDIUM_MANTICORE_FONT);
g2D.setColor(Settings.MANTICORE_DARK_BLUE);
g2D.drawString(title, inset, inset);
}
Iterator<String> stringIterator=stringVector.iterator();
float x=10f;
float y=10f;
while (stringIterator.hasNext()) {
g2D.drawString(stringIterator.next(), x, y);
y+=10f;
}
}
}
@Override
public void paint(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
g2D.drawImage(bufferedImage, 0, 0, this);
}
public void drawBar(Graphics2D g2D, int i, float dx, float offset, float dy, float value) {
Rectangle2D.Float rect = null;
if (value < 0) {
g2D.setColor(Settings.MANTICORE_ORANGE);
rect = new Rectangle2D.Float(inset + i * dx + dx / 2 - 2, getHeight() - inset + (offset) * dy, 4, -value * dy);
} else {
g2D.setColor(Settings.MANTICORE_DARK_BLUE);
rect = new Rectangle2D.Float(inset + i * dx + dx / 2 - 2, getHeight() - inset + (offset - value) * dy, 4, value * dy);
}
if (showDataPointCaption)
g2D.drawString(decimalFormat.format(value), inset + i * dx + dx / 2, getHeight() - inset + (offset - value) * dy);
g2D.fill(rect);
}
public void mouseDragged(MouseEvent e) {
}
public void mouseMoved(MouseEvent e) {
CategoryDataPoint dataPoint = getNearestPoint(e.getPoint());
String s = dataPoint.getDate() + " " + dataPoint.value;
setToolTipText(dataPoint.getDate() + " " + dataPoint.value);
}
private CategoryDataPoint getNearestPoint(Point2D point) {
CategoryDataPoint dataPoint = null;
// double minDistance=Double.MAX_VALUE;
//
// for (int i=0; i< dataPoints.length;i++) {
// double distance=dataPoints[i].point.distance(point);
//
// if (distance<minDistance) {
// minDistance=distance;
// dataPoint=dataPoints[i];
// }
// }
return dataPoint;
}
public void componentResized(ComponentEvent e) {
bufferedImage = this.getGraphicsConfiguration().createCompatibleImage(getWidth(), getHeight());
drawChart();
}
public void componentMoved(ComponentEvent e) {
}
public void componentShown(ComponentEvent e) {
}
public void componentHidden(ComponentEvent e) {
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
public class ChartObject {
Float offset;
Float range;
Float dy2;
float average = 0f;
int gridLinesCount;
DataPoint[] dataPoints;
public void setRange(Float maxValue, Float minValue) {
double t1 = Math.ceil(Math.log10(Math.abs(maxValue))) - 1;
double t2 = Math.ceil(Math.log10(Math.abs(minValue))) - 1;
double t = Math.max(t1, t2);
maxValue = (float) (Math.ceil(Math.abs(maxValue) / Math.pow(10d, t)) * Math.pow(10d, t)) * Math.signum(maxValue);
minValue = (float) (Math.ceil(Math.abs(minValue) / Math.pow(10d, t)) * Math.pow(10d, t)) * Math.signum(minValue);
if (minValue < 0 && maxValue <= 0) {
offset = minValue;
range = -minValue;
} else if (minValue < 0 && maxValue > 0) {
offset = minValue;
range = (maxValue - minValue);
} else {
offset = 0f;
range = maxValue;
}
dy2 = (float) maxValue / (float) gridlines;
}
}
}
| UTF-8 | Java | 11,210 | java | ChartPanel.java | Java | [
{
"context": "/*\n *\n * Copyright (C) 2010 Andreas Reichel <andreas@manticore-projects.com>\n *\n * ~~~~~~~~~~",
"end": 44,
"score": 0.9998814463615417,
"start": 29,
"tag": "NAME",
"value": "Andreas Reichel"
},
{
"context": "/*\n *\n * Copyright (C) 2010 Andreas Reichel <andreas@m... | null | [] | /*
*
* Copyright (C) 2010 <NAME> <<EMAIL>>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
package com.manticore.report;
import com.manticore.util.Settings;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.TreeSet;
import java.util.Vector;
import javax.swing.JPanel;
import org.joda.time.DurationFieldType;
abstract class ChartPanel extends JPanel implements MouseMotionListener, ComponentListener {
public TreeSet<DataPoint> dataPointVector;
public TreeSet<DataPoint> dataPointVector2;
public final static int inset = 12;
public final static int gridlines = 5;
public final static DurationFieldType durationFieldType = DurationFieldType.days();
private int chartMode = LINE;
public String title;
public boolean showDataPointCaption=false;
public final static int LINE = 0;
public final static int BAR = 1;
public BufferedImage bufferedImage = null;
public DecimalFormat decimalFormat;
public Vector<String> stringVector;
public ChartPanel() {
this.title = "";
dataPointVector = new TreeSet<DataPoint>();
dataPointVector2 = new TreeSet<DataPoint>();
decimalFormat = (DecimalFormat) DecimalFormat.getInstance();
decimalFormat.setMaximumFractionDigits(2);
decimalFormat.setMinimumFractionDigits(2);
decimalFormat.setGroupingUsed(true);
addComponentListener(this);
stringVector=new Vector<String>();
}
public ChartPanel(String title) {
this.title = title;
dataPointVector = new TreeSet<DataPoint>();
decimalFormat = (DecimalFormat) DecimalFormat.getInstance();
decimalFormat.setMaximumFractionDigits(2);
decimalFormat.setMinimumFractionDigits(2);
decimalFormat.setGroupingUsed(true);
addComponentListener(this);
stringVector=new Vector<String>();
}
public void addData(String key, Float value) {
CategoryDataPoint dataPoint = new CategoryDataPoint(key, value);
dataPointVector.add(dataPoint);
}
public void addData(long key, Float value) {
TimeDataPoint dataPoint = new TimeDataPoint(new Date(key), value);
dataPointVector.add(dataPoint);
}
public void addData(int key, Float value) {
SlotDataPoint dataPoint = new SlotDataPoint(key, value);
dataPointVector.add(dataPoint);
}
public void addData2(int key, Float value) {
SlotDataPoint dataPoint = new SlotDataPoint(key, value);
dataPointVector2.add(dataPoint);
}
public abstract ChartObject getChartObject();
public void drawPlotObjects(Graphics2D g2D, ChartObject chartObject, float dx, float dy) {
for (int i = 0; i < chartObject.dataPoints.length; i++) {
if (chartObject.dataPoints[i] != null) {
drawBar(g2D, i, dx, chartObject.offset, dy, chartObject.dataPoints[i].value);
}
}
}
public void drawChart() {
if (bufferedImage == null && this.getGraphicsConfiguration() != null) {
bufferedImage = this.getGraphicsConfiguration().createCompatibleImage(getWidth(), getHeight());
}
if (bufferedImage != null) {
Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
g2D.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
g2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
g2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g2D.setColor(Color.WHITE);
g2D.fillRect(0, 0, getWidth(), getHeight());
ChartObject chartObject = getChartObject();
float dx = (float) (getWidth() - 2 * inset) / (float) chartObject.gridLinesCount;
float dy = ((float) (getHeight() - 2 * inset)) / (chartObject.range);
g2D.setColor(Settings.MANTICORE_DARK_GREY);
for (int i = 0; i < gridlines; i++) {
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy));
g2D.drawString(decimalFormat.format(chartObject.dy2*i), inset, getHeight() - inset + (chartObject.offset - chartObject.dy2 * i) * dy);
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy));
g2D.drawString(decimalFormat.format(-chartObject.dy2*i), inset, getHeight() - inset + (chartObject.offset + chartObject.dy2 * i) * dy);
}
for (int i = 0; i < chartObject.gridLinesCount; i++) {
g2D.draw(new Line2D.Float(inset + i * dx + dx / 2, inset, inset + i * dx + dx / 2, getHeight() - inset));
}
dx = (float) (getWidth() - 2 * inset) / (float) chartObject.dataPoints.length;
dy = ((float) (getHeight() - 2 * inset)) / chartObject.range;
//draw average if exists
if (chartObject.average != 0f) {
g2D.setColor(Settings.MANTICORE_ORANGE);
g2D.draw(new Line2D.Float(inset, getHeight() - inset + (chartObject.offset - chartObject.average) * dy, getWidth() - inset, getHeight() - inset + (chartObject.offset - chartObject.average) * dy));
}
drawPlotObjects(g2D, chartObject, dx, dy);
if (title.length() > 0) {
g2D.setFont(Settings.MEDIUM_MANTICORE_FONT);
g2D.setColor(Settings.MANTICORE_DARK_BLUE);
g2D.drawString(title, inset, inset);
}
Iterator<String> stringIterator=stringVector.iterator();
float x=10f;
float y=10f;
while (stringIterator.hasNext()) {
g2D.drawString(stringIterator.next(), x, y);
y+=10f;
}
}
}
@Override
public void paint(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
g2D.drawImage(bufferedImage, 0, 0, this);
}
public void drawBar(Graphics2D g2D, int i, float dx, float offset, float dy, float value) {
Rectangle2D.Float rect = null;
if (value < 0) {
g2D.setColor(Settings.MANTICORE_ORANGE);
rect = new Rectangle2D.Float(inset + i * dx + dx / 2 - 2, getHeight() - inset + (offset) * dy, 4, -value * dy);
} else {
g2D.setColor(Settings.MANTICORE_DARK_BLUE);
rect = new Rectangle2D.Float(inset + i * dx + dx / 2 - 2, getHeight() - inset + (offset - value) * dy, 4, value * dy);
}
if (showDataPointCaption)
g2D.drawString(decimalFormat.format(value), inset + i * dx + dx / 2, getHeight() - inset + (offset - value) * dy);
g2D.fill(rect);
}
public void mouseDragged(MouseEvent e) {
}
public void mouseMoved(MouseEvent e) {
CategoryDataPoint dataPoint = getNearestPoint(e.getPoint());
String s = dataPoint.getDate() + " " + dataPoint.value;
setToolTipText(dataPoint.getDate() + " " + dataPoint.value);
}
private CategoryDataPoint getNearestPoint(Point2D point) {
CategoryDataPoint dataPoint = null;
// double minDistance=Double.MAX_VALUE;
//
// for (int i=0; i< dataPoints.length;i++) {
// double distance=dataPoints[i].point.distance(point);
//
// if (distance<minDistance) {
// minDistance=distance;
// dataPoint=dataPoints[i];
// }
// }
return dataPoint;
}
public void componentResized(ComponentEvent e) {
bufferedImage = this.getGraphicsConfiguration().createCompatibleImage(getWidth(), getHeight());
drawChart();
}
public void componentMoved(ComponentEvent e) {
}
public void componentShown(ComponentEvent e) {
}
public void componentHidden(ComponentEvent e) {
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
public class ChartObject {
Float offset;
Float range;
Float dy2;
float average = 0f;
int gridLinesCount;
DataPoint[] dataPoints;
public void setRange(Float maxValue, Float minValue) {
double t1 = Math.ceil(Math.log10(Math.abs(maxValue))) - 1;
double t2 = Math.ceil(Math.log10(Math.abs(minValue))) - 1;
double t = Math.max(t1, t2);
maxValue = (float) (Math.ceil(Math.abs(maxValue) / Math.pow(10d, t)) * Math.pow(10d, t)) * Math.signum(maxValue);
minValue = (float) (Math.ceil(Math.abs(minValue) / Math.pow(10d, t)) * Math.pow(10d, t)) * Math.signum(minValue);
if (minValue < 0 && maxValue <= 0) {
offset = minValue;
range = -minValue;
} else if (minValue < 0 && maxValue > 0) {
offset = minValue;
range = (maxValue - minValue);
} else {
offset = 0f;
range = maxValue;
}
dy2 = (float) maxValue / (float) gridlines;
}
}
}
| 11,178 | 0.624978 | 0.611954 | 286 | 38.195805 | 37.066139 | 212 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.797203 | false | false | 14 |
003d3fc530fc802df2b45b7576607ad70b74e062 | 6,502,580,539,811 | 8763d83d0ef51279e190661ecf9fa77f355756a2 | /src/main/java/com/ukefu/webim/service/repository/AiSNSAccountRepository.java | 1e2ad3e149cdc81480216aea6c5e5c5d1864ccf0 | [
"Apache-2.0"
] | permissive | jacken0759/webim | https://github.com/jacken0759/webim | 77c0803f7ea5b93d83545abd986ae608cfed2af9 | 4dbd0546f8418611268cec7b1c6a3c875e03d714 | refs/heads/master | 2020-04-17T13:21:03.468000 | 2019-01-19T10:08:38 | 2019-01-19T10:08:38 | 166,611,933 | 3 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ukefu.webim.service.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.ukefu.webim.web.model.AiSNSAccount;
public abstract interface AiSNSAccountRepository extends JpaRepository<AiSNSAccount, String>
{
public abstract List<AiSNSAccount> findByOrgiAndAiid(String orgi ,String aiid);
public abstract List<AiSNSAccount> findByOrgiAndSnsid(String orgi ,String snsid);
public abstract List<AiSNSAccount> findByOrgi(String orgi);
}
| UTF-8 | Java | 528 | java | AiSNSAccountRepository.java | Java | [] | null | [] | package com.ukefu.webim.service.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.ukefu.webim.web.model.AiSNSAccount;
public abstract interface AiSNSAccountRepository extends JpaRepository<AiSNSAccount, String>
{
public abstract List<AiSNSAccount> findByOrgiAndAiid(String orgi ,String aiid);
public abstract List<AiSNSAccount> findByOrgiAndSnsid(String orgi ,String snsid);
public abstract List<AiSNSAccount> findByOrgi(String orgi);
}
| 528 | 0.789773 | 0.789773 | 17 | 28.941177 | 33.701931 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.941176 | false | false | 14 |
09fc5bf295b8f71a48dee649329435e251a5d177 | 34,720,515,633,352 | ddec46506cbdee03b495b7bc287b14abab12c701 | /Test/src/main/java/Synchronized/Test2.java | 63940c7d8107d0e6ebe69a11d3bcab088c6d43be | [] | no_license | kvenLin/JDK-Source | https://github.com/kvenLin/JDK-Source | f86737d3761102933c4b87730bca8928a5885287 | 1ff43b09f1056d91de97356be388d58c98ba1982 | refs/heads/master | 2023-08-10T11:26:59.051000 | 2023-07-20T06:48:45 | 2023-07-20T06:48:45 | 161,105,850 | 60 | 24 | null | false | 2022-06-17T02:19:27 | 2018-12-10T02:37:12 | 2022-05-29T11:58:17 | 2022-06-17T02:19:26 | 21,188 | 48 | 22 | 1 | Java | false | false | package Synchronized;
/**
* @Author: clf
* @Date: 19-3-17
* @Description:
*/
public class Test2 {
public synchronized void method(){
System.out.println("test2");
}
}
| UTF-8 | Java | 188 | java | Test2.java | Java | [
{
"context": "package Synchronized;\n\n/**\n * @Author: clf\n * @Date: 19-3-17\n * @Description:\n */\npublic cla",
"end": 42,
"score": 0.9959337115287781,
"start": 39,
"tag": "USERNAME",
"value": "clf"
}
] | null | [] | package Synchronized;
/**
* @Author: clf
* @Date: 19-3-17
* @Description:
*/
public class Test2 {
public synchronized void method(){
System.out.println("test2");
}
}
| 188 | 0.601064 | 0.56383 | 12 | 14.666667 | 12.552114 | 39 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | false | false | 14 |
91081beaccac8f1b5e548c86403a2f0e4538902b | 6,768,868,474,415 | 17f76f8c471673af9eae153c44e5d9776c82d995 | /convertor/java_code/includes/skydiverH.java | c07d8efbb3947b8c3aa68cd4153537e643c23ab5 | [] | no_license | javaemus/arcadeflex-067 | https://github.com/javaemus/arcadeflex-067 | ef1e47f8518cf214acc5eb246b1fde0d6cbc0028 | 1ea6e5c6a73cf8bca5d234b26d2b5b6312df3931 | refs/heads/main | 2023-02-25T09:25:56.492000 | 2021-02-05T11:40:36 | 2021-02-05T11:40:36 | 330,649,950 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*************************************************************************
Atari Skydiver hardware
*************************************************************************/
/*----------- defined in vidhrdw/skydiver.c -----------*/
extern data8_t *skydiver_videoram;
MACHINE_INIT( skydiver );
VIDEO_START( skydiver );
VIDEO_UPDATE( skydiver );
| UTF-8 | Java | 350 | java | skydiverH.java | Java | [] | null | [] | /*************************************************************************
Atari Skydiver hardware
*************************************************************************/
/*----------- defined in vidhrdw/skydiver.c -----------*/
extern data8_t *skydiver_videoram;
MACHINE_INIT( skydiver );
VIDEO_START( skydiver );
VIDEO_UPDATE( skydiver );
| 350 | 0.371429 | 0.368571 | 13 | 25.923077 | 26.345228 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.384615 | false | false | 14 |
a05fbee3eeeaafd71415a5958c3d6dd67b5d70e6 | 36,361,193,130,747 | 6f11a11fbf392ca0a62be1e6c75439736cabbb71 | /app/src/main/java/org/htmlcoin/wallet/ui/fragment/wallet_fragment/ProgressBarHolder.java | a108d85473aaf0e66814bbe1139f424bd1a4e403 | [] | no_license | denuoweb/htmlcoin-android-wallet | https://github.com/denuoweb/htmlcoin-android-wallet | 9a236f5629df2bf2783b3a76381c4439bdc1963d | d36bb4b45cb00b88d30d047f120173b274caa1fa | HEAD | 2018-10-22T17:23:34.231000 | 2018-09-05T02:44:14 | 2018-09-05T02:44:14 | 137,719,930 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.htmlcoin.wallet.ui.fragment.wallet_fragment;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ProgressBar;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ProgressBarHolder extends RecyclerView.ViewHolder {
@BindView(org.htmlcoin.wallet.R.id.progressBar)
ProgressBar mProgressBar;
public ProgressBarHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bindProgressBar(boolean mLoadingFlag) {
if (mLoadingFlag) {
mProgressBar.setVisibility(View.VISIBLE);
} else {
mProgressBar.setVisibility(View.GONE);
}
}
}
| UTF-8 | Java | 722 | java | ProgressBarHolder.java | Java | [] | null | [] | package org.htmlcoin.wallet.ui.fragment.wallet_fragment;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ProgressBar;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ProgressBarHolder extends RecyclerView.ViewHolder {
@BindView(org.htmlcoin.wallet.R.id.progressBar)
ProgressBar mProgressBar;
public ProgressBarHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bindProgressBar(boolean mLoadingFlag) {
if (mLoadingFlag) {
mProgressBar.setVisibility(View.VISIBLE);
} else {
mProgressBar.setVisibility(View.GONE);
}
}
}
| 722 | 0.716066 | 0.714681 | 27 | 25.74074 | 21.22122 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 14 |
57b17593b9c292035351615142d9ac160d51259d | 29,094,108,528,258 | f67738ac7b21f0291970bdbf9a11b7381ffe0150 | /src/homework/dataStructures/easy/CharStack.java | 262ea89d708b65fef1bac2d81ccc6da4af4c53c6 | [] | no_license | GrzegorzKaczor/programowanie1 | https://github.com/GrzegorzKaczor/programowanie1 | 74a1a8f7f4ba644ceb6d218a09f3a99083902839 | 4bd5eea90e71d86445cece914d3b9227bc65c490 | refs/heads/master | 2020-03-30T06:27:36.298000 | 2018-09-29T12:40:06 | 2018-09-29T12:40:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package homework.dataStructures.easy;
public class CharStack {
private int top;
private int size;
private char[] arrayString;
public CharStack(int size) {
this.size = size;
this.arrayString = new char[size];
top = -1;
}
public void push(char element) {
if (top < arrayString.length - 1) {
top++;
arrayString[top] = element;
}
return;
// Po co wyjątek w if??
}
public char pop() throws EmptyCharStackExeption {
if (!isEmpty()) {
char element = arrayString[top];
top--;
return element;
}
throw new EmptyCharStackExeption();
}
public boolean isFull() {
return top == arrayString.length - 1;
}
public boolean isEmpty() {
return top == -1;
}
}
| UTF-8 | Java | 873 | java | CharStack.java | Java | [] | null | [] | package homework.dataStructures.easy;
public class CharStack {
private int top;
private int size;
private char[] arrayString;
public CharStack(int size) {
this.size = size;
this.arrayString = new char[size];
top = -1;
}
public void push(char element) {
if (top < arrayString.length - 1) {
top++;
arrayString[top] = element;
}
return;
// Po co wyjątek w if??
}
public char pop() throws EmptyCharStackExeption {
if (!isEmpty()) {
char element = arrayString[top];
top--;
return element;
}
throw new EmptyCharStackExeption();
}
public boolean isFull() {
return top == arrayString.length - 1;
}
public boolean isEmpty() {
return top == -1;
}
}
| 873 | 0.521789 | 0.517202 | 43 | 19.27907 | 16.176823 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.372093 | false | false | 14 |
26bbf32037264e622eb239d986e50d78a9af203b | 1,511,828,528,362 | fb59181e3ce82fb7ac22c4cce292e2f02e601690 | /src/test/resources/e2e/web_examples/LazyBooleanOperations.java | 2c1e23e5a9c56967ea755392f70a0e828f62a202 | [
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | jrbeverly/jcompiler | https://github.com/jrbeverly/jcompiler | c9ea6f3f56961d9a25d1a759fc4ad7548b2a235b | 0ed0b813fd2f3452d9c5ecb284295f250bdfba20 | refs/heads/main | 2021-12-03T21:10:08.654000 | 2021-10-04T23:40:33 | 2021-10-04T23:40:33 | 155,794,215 | 4 | 0 | MIT | false | 2021-09-18T01:02:59 | 2018-11-02T00:52:14 | 2021-05-19T03:40:17 | 2021-09-18T01:02:58 | 2,690 | 3 | 0 | 0 | Java | false | false | public class LazyBooleanOperations {
public LazyBooleanOperations() {}
public boolean m(boolean x) {
return (x && true) || x;
}
}
| UTF-8 | Java | 166 | java | LazyBooleanOperations.java | Java | [] | null | [] | public class LazyBooleanOperations {
public LazyBooleanOperations() {}
public boolean m(boolean x) {
return (x && true) || x;
}
}
| 166 | 0.560241 | 0.560241 | 6 | 26.666666 | 13.816255 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 14 |
bda937120822528fed2350739e3f3e03524e8a79 | 12,421,045,433,218 | c8b739dd5391eced0fad5a4804c58f73c7655db5 | /src/com/bjsxt/abstractfactory/LuxuyEngine.java | 73e53773607c2995db57f7055fae66a28e4693ac | [] | no_license | hyy987/javaDemo | https://github.com/hyy987/javaDemo | 95c198808c62cea44e6ec737218aec88953bc67b | e1b762d7abd6e15da9f613b1293877d6cf7cd867 | refs/heads/master | 2020-04-29T14:14:58.873000 | 2019-05-20T23:09:46 | 2019-05-20T23:09:46 | 176,190,686 | 0 | 0 | null | false | 2019-04-30T01:27:25 | 2019-03-18T02:30:45 | 2019-04-30T01:23:18 | 2019-04-30T01:25:24 | 1 | 0 | 0 | 0 | Java | false | false | package com.bjsxt.abstractfactory;
public class LuxuyEngine implements Engine {
@Override
public void run() {
System.out.println("跑的快");
}
@Override
public void filed() {
System.out.println("转速快,启动快");
}
}
class LowEngine implements Engine {
@Override
public void run() {
System.out.println("跑的慢--");
}
@Override
public void filed() {
System.out.println("转速慢,启动慢");
}
}
| UTF-8 | Java | 483 | java | LuxuyEngine.java | Java | [] | null | [] | package com.bjsxt.abstractfactory;
public class LuxuyEngine implements Engine {
@Override
public void run() {
System.out.println("跑的快");
}
@Override
public void filed() {
System.out.println("转速快,启动快");
}
}
class LowEngine implements Engine {
@Override
public void run() {
System.out.println("跑的慢--");
}
@Override
public void filed() {
System.out.println("转速慢,启动慢");
}
}
| 483 | 0.604966 | 0.604966 | 33 | 11.424242 | 13.420993 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 14 |
2f0ac7afe3932a67124ff5d65b2e5eda44785d24 | 9,070,970,944,957 | 8334d32af0c41629e78fb70d35cff412239f33cf | /exhibition-1/src/main/java/com/exhibition/controller/AdminController.java | db4c060b036db71f2df7af9d0691b3027f9d4a02 | [] | no_license | Daley-wdl/ex | https://github.com/Daley-wdl/ex | 1136f0f755c403e66fa526871da277a561f5a1ed | 1971e35efa03d015f2838e7494eeec44ceef90dd | refs/heads/master | 2021-09-10T01:19:23.341000 | 2018-03-20T13:55:45 | 2018-03-20T13:55:45 | 126,017,596 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.exhibition.controller;
import com.exhibition.enums.ExceptionEnums;
import com.exhibition.enums.RoleList;
import com.exhibition.enums.UserStatus;
import com.exhibition.po.Exhibitor;
import com.exhibition.po.Exhibits;
import com.exhibition.po.User;
import com.exhibition.service.ExhibitorService;
import com.exhibition.service.ExhibitsService;
import com.exhibition.service.UserService;
import com.exhibition.vo.LayuiReplay;
import com.exhibition.vo.ReplyList;
import com.exhibition.vo.ReplyResult;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
import org.apache.log4j.Logger;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.annotation.XmlElementRef;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("admin")
public class AdminController {
private static Logger logger = Logger.getLogger(AdminController.class);
@Autowired
private UserService userService;
@Autowired
private ExhibitorService exhibitorService;
@Autowired
private ExhibitsService exhibitsService;
/**
* 得到所有的user
* @param page
* @param pageSize
* @return
*/
@RequestMapping(value="/getAllUser",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String getAllUser(@RequestParam("page") Integer page, @RequestParam("size") Integer pageSize) {
Gson gson=new Gson();
List<User> userList=userService.selectUserByRole(RoleList.User.getRoleId(),page,pageSize);
//如果user不为空返回json
int count= userList.size();
if(userList==null){
return gson.toJson(new ReplyResult(1,"没有用户"));
}
return gson.toJson(new LayuiReplay<User>(0,"OK",count,userList));
}
/**
* 根据名字和状态查询
* @param page
* @param size
* @param name
* @param status
* @return
*/
@RequestMapping(value="/searchUser",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String searchUser(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<User> userList=userService.searchUserByName(page,size,name,status);
int count=userList.size();
if(userList==null){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<User>(0,"OK",count,userList));
}
/**
* 根据id删除user
* @param users
* @return
*/
@RequestMapping("remove")
@ResponseBody
public String remove(@RequestParam("users") String users){
Gson gson=new Gson();
//将json转换成exhibits类型
Type type = new TypeToken<List<User>>() {}.getType();
List<User> rs=gson.fromJson(users, type);
// 取出该展品
for(User e:rs){
User user = userService.findUserById(e.getUserId());
if (user == null) {
return gson.toJson(new ReplyResult(0, "展品不存在!"));
}
userService.deleteUser(e.getUserId());
logger.info("删除"+e.getUsername());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
/**
* 根据名字查询
* @param username
* @param page
* @param size
* @return
*/
@RequestMapping(value="/getUserByName", method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String getUserByName(@RequestParam("username") String username, @RequestParam("page")Integer page,@RequestParam("size")Integer size){
Gson gson=new Gson();
User user=userService.findUserByName(username);
if(user!=null){
return gson.toJson(user);
}
return gson.toJson(new ReplyResult(0,"未找到该用户"));
}
/**
* 解锁/上锁用户
* @param username
* @param locked
*/
@RequestMapping("lockUser")
@ResponseBody
public String lockUser(@RequestParam("username") String username, @RequestParam("locked") boolean locked){
Gson gson=new Gson();
if(username!=null||username!=""){
userService.lockUser(username,locked);
return locked? gson.toJson(new ReplyResult(0,"锁定用户")):gson.toJson(new ReplyResult(0,"解锁用户"));
}
return gson.toJson(new ReplyResult(1,"该用户不存在"));
}
/*******************************对exhibitor操作**********************************/
/**
* 查询所有已审核通过的展商
* @param request
* @return
*/
@RequestMapping(value="/listAllExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Passed.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Passed.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
*
* @Descoption 查询所有待审核的展商
* @return String
*/
@RequestMapping(value="/listAllCheckingExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllCheckingExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Waiting.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Waiting.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
*
* @Description 设置展商的审核状态status
* @return String :返回json字符串:status:状态(1正常,0出错),如果出错--error:错误信息
*/
@RequestMapping(value="/setExhibitorStatus", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String setExhibitorStatus( @RequestParam("exhibitor") String exhibitor,@RequestParam("status") String status) {
Gson gson = new Gson();
String result=null;
if (!UserStatus.checkStatus(status)) {
//如果status不合法
return gson.toJson(new ReplyResult(0,"status错误!"));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibitor>>() {}.getType();
List<Exhibitor> rs=gson.fromJson(exhibitor, type);
// 取出该展品
for(Exhibitor e:rs){
if(null==exhibitorService.selectByUserId(e.getId())){
result = gson.toJson(new ReplyResult(0, "对应展品不存在"));
}
Exhibitor extor = new Exhibitor();
extor.setUserId(e.getUserId());
extor.setStatus(status);
exhibitorService.updateExhibitor(extor);
logger.info("通过审核:"+e.getRealName());
}
return gson.toJson(new ReplyResult(1,"修改成功!"));
}
/**
*
* @Descoption 查询所有未通过审核的展商
* @param request
* @return String
*/
@RequestMapping(value="/listAllFailExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllFailExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
// List<Exhibitor> exhibitors = exhibitorDao.getAllCheckingExhibitor();
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Failed.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Failed.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
* 根据userid删除exhibitor
* @param exhibitor
* @return
*/
@RequestMapping(value="/removeExhibitor", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String removeExhibitor(@RequestParam("exhibitor") String exhibitor){
Gson gson=new Gson();
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibitor>>() {}.getType();
List<Exhibitor> rs=gson.fromJson(exhibitor, type);
// 取出该展品
for(Exhibitor e:rs){
Exhibitor extor = exhibitorService.selectByUserId(e.getUserId());
if (extor == null) {
return gson.toJson(new ReplyResult(0, "展商不存在!"));
}
exhibitorService.deleteExhibitor(e.getUserId());
logger.info("删除"+e.getRealName());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
@RequestMapping(value="/searchExhibitorByName", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String searchExhibitorByName(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<Exhibitor> exhibitorList=exhibitorService.searchExhibitorByName(page,size,name,status);
int count=exhibitorList.size();
if(exhibitorList==null){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<Exhibitor>(0,"OK",count,exhibitorList));
}
/*******************************对exhibitor操作**********************************/
/*******************************对exhibits操作**********************************/
/**
*
* 获取所有审核不通过的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectFailedExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectFailedExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Failed.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Failed.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK",count, exhibits));
logger.info(resultJson);
return resultJson;
}
/**
*
* 获取所有审核通过的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectAllExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Passed.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Passed.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK", count,exhibits));
logger.info(resultJson);
return resultJson;
}
/**
* 根据名字和状态查询展品
* @param page
* @param size
* @param name
* @param status
* @return
*/
@RequestMapping(value="/searchExhibitsByName", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String searchExhibitsByName(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<Exhibits> exhibitsList=exhibitsService.searchExhibitsByName(page,size,name,status);
int count=exhibitsList.size();
if(count==0){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<Exhibits>(0,"OK",count,exhibitsList));
}
/**
* @Description 管理员通过商品id删除商品
* @param exhibits
* @return
*/
@RequestMapping(value="/removeExhibits",produces={"application/json;charset=UTF-8"},method=RequestMethod.GET)
@ResponseBody
public String removeExhibits(@RequestParam("exhibits")String exhibits){
Gson gson=new Gson();
Subject subject= SecurityUtils.getSubject();
Integer userId = (Integer) subject.getSession().getAttribute("userId");
// 验证权限
if (!subject.hasRole(RoleList.Manager.getRoleName())) {
return gson.toJson(new ReplyResult(0, "没有该权限!"));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibits>>() {}.getType();
List<Exhibits> rs=gson.fromJson(exhibits, type);
// 取出该展品
for(Exhibits e:rs){
Exhibits exts = exhibitsService.getExhibitsById(e.getId());
if (exts == null) {
return gson.toJson(new ReplyResult(0, "展品不存在!"));
}
exhibitsService.delete(e.getId());
logger.info("删除"+e.getExhibitsName());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
/**
*
* 获取所有待审核的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectCheckingExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectCheckingExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Waiting.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Waiting.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK", count,exhibits));
logger.info(resultJson);
return resultJson;
}
/**
*
* @Description 设置展品的审核状态(ajax请求,返回json字符串)
* @param exhibits
* :展品的id
* @param status
* :展品审核状态:1--通过。0--待审核,-1--未通过
* @return String
* :json格式--成功:"status":"1";错误:"status":"0","error":"errorMsg..."
*/
@RequestMapping(value = "/setExhibitsStatus", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String setExhibitsStatus(@RequestParam("exhibits") String exhibits,
@RequestParam("status") String status) {
String result = null;
// 生成json
Gson gson = new Gson();
if (!UserStatus.checkStatus(status)) {
//检查status是否合法
result = gson.toJson(new ReplyResult(0, ExceptionEnums.WrongStatus.getMessage()));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibits>>() {}.getType();
List<Exhibits> rs=gson.fromJson(exhibits, type);
// 取出该展品
for(Exhibits e:rs){
if(null==exhibitsService.getExhibitsById(e.getId())){
result = gson.toJson(new ReplyResult(0, "对应展品不存在"));
}
Exhibits exts = new Exhibits();
exts.setId(e.getId());
exts.setStatus(status);
exhibitsService.update(exts);
}
result = gson.toJson(new ReplyResult(1, "修改成功!"));
return result;
}
/*******************************对exhibits操作**********************************/
}
| UTF-8 | Java | 16,764 | java | AdminController.java | Java | [
{
"context": "该用户\"));\n }\n /**\n * 解锁/上锁用户\n * @param username\n * @param locked\n */\n @RequestMapping(",
"end": 4269,
"score": 0.9015241861343384,
"start": 4261,
"tag": "USERNAME",
"value": "username"
}
] | null | [] | package com.exhibition.controller;
import com.exhibition.enums.ExceptionEnums;
import com.exhibition.enums.RoleList;
import com.exhibition.enums.UserStatus;
import com.exhibition.po.Exhibitor;
import com.exhibition.po.Exhibits;
import com.exhibition.po.User;
import com.exhibition.service.ExhibitorService;
import com.exhibition.service.ExhibitsService;
import com.exhibition.service.UserService;
import com.exhibition.vo.LayuiReplay;
import com.exhibition.vo.ReplyList;
import com.exhibition.vo.ReplyResult;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
import org.apache.log4j.Logger;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.annotation.XmlElementRef;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("admin")
public class AdminController {
private static Logger logger = Logger.getLogger(AdminController.class);
@Autowired
private UserService userService;
@Autowired
private ExhibitorService exhibitorService;
@Autowired
private ExhibitsService exhibitsService;
/**
* 得到所有的user
* @param page
* @param pageSize
* @return
*/
@RequestMapping(value="/getAllUser",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String getAllUser(@RequestParam("page") Integer page, @RequestParam("size") Integer pageSize) {
Gson gson=new Gson();
List<User> userList=userService.selectUserByRole(RoleList.User.getRoleId(),page,pageSize);
//如果user不为空返回json
int count= userList.size();
if(userList==null){
return gson.toJson(new ReplyResult(1,"没有用户"));
}
return gson.toJson(new LayuiReplay<User>(0,"OK",count,userList));
}
/**
* 根据名字和状态查询
* @param page
* @param size
* @param name
* @param status
* @return
*/
@RequestMapping(value="/searchUser",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String searchUser(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<User> userList=userService.searchUserByName(page,size,name,status);
int count=userList.size();
if(userList==null){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<User>(0,"OK",count,userList));
}
/**
* 根据id删除user
* @param users
* @return
*/
@RequestMapping("remove")
@ResponseBody
public String remove(@RequestParam("users") String users){
Gson gson=new Gson();
//将json转换成exhibits类型
Type type = new TypeToken<List<User>>() {}.getType();
List<User> rs=gson.fromJson(users, type);
// 取出该展品
for(User e:rs){
User user = userService.findUserById(e.getUserId());
if (user == null) {
return gson.toJson(new ReplyResult(0, "展品不存在!"));
}
userService.deleteUser(e.getUserId());
logger.info("删除"+e.getUsername());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
/**
* 根据名字查询
* @param username
* @param page
* @param size
* @return
*/
@RequestMapping(value="/getUserByName", method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String getUserByName(@RequestParam("username") String username, @RequestParam("page")Integer page,@RequestParam("size")Integer size){
Gson gson=new Gson();
User user=userService.findUserByName(username);
if(user!=null){
return gson.toJson(user);
}
return gson.toJson(new ReplyResult(0,"未找到该用户"));
}
/**
* 解锁/上锁用户
* @param username
* @param locked
*/
@RequestMapping("lockUser")
@ResponseBody
public String lockUser(@RequestParam("username") String username, @RequestParam("locked") boolean locked){
Gson gson=new Gson();
if(username!=null||username!=""){
userService.lockUser(username,locked);
return locked? gson.toJson(new ReplyResult(0,"锁定用户")):gson.toJson(new ReplyResult(0,"解锁用户"));
}
return gson.toJson(new ReplyResult(1,"该用户不存在"));
}
/*******************************对exhibitor操作**********************************/
/**
* 查询所有已审核通过的展商
* @param request
* @return
*/
@RequestMapping(value="/listAllExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Passed.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Passed.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
*
* @Descoption 查询所有待审核的展商
* @return String
*/
@RequestMapping(value="/listAllCheckingExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllCheckingExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Waiting.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Waiting.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
*
* @Description 设置展商的审核状态status
* @return String :返回json字符串:status:状态(1正常,0出错),如果出错--error:错误信息
*/
@RequestMapping(value="/setExhibitorStatus", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String setExhibitorStatus( @RequestParam("exhibitor") String exhibitor,@RequestParam("status") String status) {
Gson gson = new Gson();
String result=null;
if (!UserStatus.checkStatus(status)) {
//如果status不合法
return gson.toJson(new ReplyResult(0,"status错误!"));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibitor>>() {}.getType();
List<Exhibitor> rs=gson.fromJson(exhibitor, type);
// 取出该展品
for(Exhibitor e:rs){
if(null==exhibitorService.selectByUserId(e.getId())){
result = gson.toJson(new ReplyResult(0, "对应展品不存在"));
}
Exhibitor extor = new Exhibitor();
extor.setUserId(e.getUserId());
extor.setStatus(status);
exhibitorService.updateExhibitor(extor);
logger.info("通过审核:"+e.getRealName());
}
return gson.toJson(new ReplyResult(1,"修改成功!"));
}
/**
*
* @Descoption 查询所有未通过审核的展商
* @param request
* @return String
*/
@RequestMapping(value="/listAllFailExhibitor",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String listAllFailExhibitor(HttpServletRequest request,
@RequestParam("page")Integer page,@RequestParam("size")Integer pageSize){
// List<Exhibitor> exhibitors = exhibitorDao.getAllCheckingExhibitor();
List<Exhibitor> exhibitors = exhibitorService.selectAllExhibitor(page, pageSize, UserStatus.Failed.getStatus());
int count = exhibitorService.selectTotal(UserStatus.Failed.getStatus());
return new Gson().toJson(new LayuiReplay<Exhibitor>( 0,"OK",count,exhibitors));
}
/**
* 根据userid删除exhibitor
* @param exhibitor
* @return
*/
@RequestMapping(value="/removeExhibitor", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String removeExhibitor(@RequestParam("exhibitor") String exhibitor){
Gson gson=new Gson();
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibitor>>() {}.getType();
List<Exhibitor> rs=gson.fromJson(exhibitor, type);
// 取出该展品
for(Exhibitor e:rs){
Exhibitor extor = exhibitorService.selectByUserId(e.getUserId());
if (extor == null) {
return gson.toJson(new ReplyResult(0, "展商不存在!"));
}
exhibitorService.deleteExhibitor(e.getUserId());
logger.info("删除"+e.getRealName());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
@RequestMapping(value="/searchExhibitorByName", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String searchExhibitorByName(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<Exhibitor> exhibitorList=exhibitorService.searchExhibitorByName(page,size,name,status);
int count=exhibitorList.size();
if(exhibitorList==null){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<Exhibitor>(0,"OK",count,exhibitorList));
}
/*******************************对exhibitor操作**********************************/
/*******************************对exhibits操作**********************************/
/**
*
* 获取所有审核不通过的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectFailedExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectFailedExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Failed.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Failed.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK",count, exhibits));
logger.info(resultJson);
return resultJson;
}
/**
*
* 获取所有审核通过的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectAllExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Passed.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Passed.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK", count,exhibits));
logger.info(resultJson);
return resultJson;
}
/**
* 根据名字和状态查询展品
* @param page
* @param size
* @param name
* @param status
* @return
*/
@RequestMapping(value="/searchExhibitsByName", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String searchExhibitsByName(@RequestParam("page")Integer page,@RequestParam("size")Integer size,
@RequestParam("name")String name,@RequestParam("status")String status){
Gson gson=new Gson();
List<Exhibits> exhibitsList=exhibitsService.searchExhibitsByName(page,size,name,status);
int count=exhibitsList.size();
if(count==0){
return gson.toJson(new ReplyResult(0,"查不到结果!"));
}
return gson.toJson(new LayuiReplay<Exhibits>(0,"OK",count,exhibitsList));
}
/**
* @Description 管理员通过商品id删除商品
* @param exhibits
* @return
*/
@RequestMapping(value="/removeExhibits",produces={"application/json;charset=UTF-8"},method=RequestMethod.GET)
@ResponseBody
public String removeExhibits(@RequestParam("exhibits")String exhibits){
Gson gson=new Gson();
Subject subject= SecurityUtils.getSubject();
Integer userId = (Integer) subject.getSession().getAttribute("userId");
// 验证权限
if (!subject.hasRole(RoleList.Manager.getRoleName())) {
return gson.toJson(new ReplyResult(0, "没有该权限!"));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibits>>() {}.getType();
List<Exhibits> rs=gson.fromJson(exhibits, type);
// 取出该展品
for(Exhibits e:rs){
Exhibits exts = exhibitsService.getExhibitsById(e.getId());
if (exts == null) {
return gson.toJson(new ReplyResult(0, "展品不存在!"));
}
exhibitsService.delete(e.getId());
logger.info("删除"+e.getExhibitsName());
}
return gson.toJson(new ReplyResult(1,"删除成功"));
}
/**
*
* 获取所有待审核的展品列表,由上架时间进行排序
*
* @param page
* @param size
* @return
*/
@RequestMapping(value = "/selectCheckingExhibits",method=RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
@ResponseBody
public String selectCheckingExhibits(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
Gson gson = new Gson();
List<Exhibits> exhibits = exhibitsService.getExhibits(page, size, UserStatus.Waiting.getStatus());
int count = exhibitsService.getCountByStatus(UserStatus.Waiting.getStatus());
String resultJson = gson.toJson(new LayuiReplay<Exhibits>(0,"OK", count,exhibits));
logger.info(resultJson);
return resultJson;
}
/**
*
* @Description 设置展品的审核状态(ajax请求,返回json字符串)
* @param exhibits
* :展品的id
* @param status
* :展品审核状态:1--通过。0--待审核,-1--未通过
* @return String
* :json格式--成功:"status":"1";错误:"status":"0","error":"errorMsg..."
*/
@RequestMapping(value = "/setExhibitsStatus", produces = { "application/json;charset=UTF-8" },method = RequestMethod.GET)
@ResponseBody
public String setExhibitsStatus(@RequestParam("exhibits") String exhibits,
@RequestParam("status") String status) {
String result = null;
// 生成json
Gson gson = new Gson();
if (!UserStatus.checkStatus(status)) {
//检查status是否合法
result = gson.toJson(new ReplyResult(0, ExceptionEnums.WrongStatus.getMessage()));
}
//将json转换成exhibits类型
Type type = new TypeToken<List<Exhibits>>() {}.getType();
List<Exhibits> rs=gson.fromJson(exhibits, type);
// 取出该展品
for(Exhibits e:rs){
if(null==exhibitsService.getExhibitsById(e.getId())){
result = gson.toJson(new ReplyResult(0, "对应展品不存在"));
}
Exhibits exts = new Exhibits();
exts.setId(e.getId());
exts.setStatus(status);
exhibitsService.update(exts);
}
result = gson.toJson(new ReplyResult(1, "修改成功!"));
return result;
}
/*******************************对exhibits操作**********************************/
}
| 16,764 | 0.626432 | 0.62297 | 431 | 35.867748 | 34.474358 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.684455 | false | false | 14 |
ad72c279aa0f776c80565213406dcf049279ce01 | 32,641,751,465,704 | 455a5a18efd35bcee4ab63633b4ccf97efdaf012 | /card-core/src/main/java/com/healthpay/modules/iface/web/HpIfaceMerchantController.java | 33f99389b5281d6ade9db3a64612147b29f3d110 | [] | no_license | mabaoying1/card-manager | https://github.com/mabaoying1/card-manager | ef862b97dcd7b24d410653cbf4c097ddf3d05d38 | 181192ff2d3db67df513f6f306ba79af428b271a | refs/heads/master | 2022-12-28T18:28:11.693000 | 2020-03-28T07:55:10 | 2020-03-28T07:55:10 | 250,744,664 | 0 | 1 | null | false | 2022-12-16T01:17:15 | 2020-03-28T08:13:11 | 2020-03-28T08:31:28 | 2022-12-16T01:17:11 | 190,081 | 0 | 1 | 33 | JavaScript | false | false | /**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package com.healthpay.modules.iface.web;
import java.io.*;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import com.healthpay.common.utils.IdGen;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.h2.mvstore.DataUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.healthpay.common.utils.DateUtils;
import com.healthpay.common.utils.MyBeanUtils;
import com.healthpay.common.config.Global;
import com.healthpay.common.persistence.Page;
import com.healthpay.common.web.BaseController;
import com.healthpay.common.utils.StringUtils;
import com.healthpay.common.utils.excel.ExportExcel;
import com.healthpay.common.utils.excel.ImportExcel;
import com.healthpay.modules.iface.entity.HpIfaceMerchant;
import com.healthpay.modules.iface.service.HpIfaceMerchantService;
import com.healthpay.modules.sys.entity.Area;
import com.healthpay.modules.sys.service.AreaService;
/**
* 商户管理Controller
* @author gyp
* @version 2016-06-14
*/
@Controller
@RequestMapping(value = "${adminPath}/interface/hpIfaceMerchant")
public class HpIfaceMerchantController extends BaseController {
@Autowired
private HpIfaceMerchantService hpIfaceMerchantService;
@Autowired
private AreaService areaService;
@ModelAttribute
public HpIfaceMerchant get(@RequestParam(required=false) String merId) {
HpIfaceMerchant entity = null;
if (StringUtils.isNotBlank(merId)){
entity = hpIfaceMerchantService.get(merId);
}
if (entity == null){
entity = new HpIfaceMerchant();
}
return entity;
}
/**
* 商户列表页面
*/
@RequiresPermissions("interface:hpIfaceMerchant:list")
@RequestMapping(value = {"list", ""})
public String list(HpIfaceMerchant hpIfaceMerchant, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<HpIfaceMerchant> page = hpIfaceMerchantService.findPage(new Page<HpIfaceMerchant>(request, response), hpIfaceMerchant);
model.addAttribute("page", page);
return "modules/iface/hpIfaceMerchantList";
}
/**
* 查看,增加,编辑商户表单页面
*/
@RequiresPermissions(value={"interface:hpIfaceMerchant:view","interface:hpIfaceMerchant:add","interface:hpIfaceMerchant:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(HpIfaceMerchant hpIfaceMerchant, Model model) {
model.addAttribute("hpIfaceMerchant", hpIfaceMerchant);
return "modules/iface/hpIfaceMerchantForm";
}
/**
* 增加商户表单页面
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:add",logical=Logical.OR)
@RequestMapping(value = "addForm")
public String addForm(HpIfaceMerchant hpIfaceMerchant, Model model) {
model.addAttribute("hpIfaceMerchant", hpIfaceMerchant);
return "modules/iface/hpIfaceMerchantAddForm";
}
/**
* 保存商户
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:add",logical=Logical.OR)
@RequestMapping(value = "saveHpIfaceMerchant")
public String saveHpIfaceMerchant(HpIfaceMerchant hpIfaceMerchant, Model model, RedirectAttributes redirectAttributes) throws Exception{
if (!beanValidator(model, hpIfaceMerchant)){
return form(hpIfaceMerchant, model);
}
HpIfaceMerchant merchant=hpIfaceMerchantService.getMerchantByOrgCode(hpIfaceMerchant.getOrgCode());
if(null !=merchant){
addMessage(redirectAttributes, "该机构已存在!");
}else{
//新增表单保存
hpIfaceMerchant.setIsNewRecord(true);
hpIfaceMerchant.setStatus("1");
hpIfaceMerchant.setMerType("1");
//查询地区信息
Area bean = areaService.get(hpIfaceMerchant.getOrgAddr().getId());
hpIfaceMerchant.setOrgAddr(bean);
hpIfaceMerchantService.saveHpIfaceMerchant(hpIfaceMerchant);//保存
addMessage(redirectAttributes, "保存商户成功");
}
/*HpIfaceMerchant t = hpIfaceMerchantService.get(hpIfaceMerchant.getMerId());//从数据库取出记录的值
if(null!=t){
addMessage(redirectAttributes, "该商户号已存在!");
}else{
//新增表单保存
hpIfaceMerchant.setIsNewRecord(true);
hpIfaceMerchant.setStatus("1");
hpIfaceMerchant.setMerType("1");
//hpIfaceMerchant.setMerId(IdGen.generateNumber());
//hpIfaceMerchant.setDigitalKey(StringUtils.getStringRandom(64));
hpIfaceMerchantService.saveHpIfaceMerchant(hpIfaceMerchant);//保存
addMessage(redirectAttributes, "保存商户成功");
}*/
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 更新商户
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:edit",logical=Logical.OR)
@RequestMapping(value = "updateHpIfacemerchant")
public String updateHpIfacemerchant(HpIfaceMerchant hpIfaceMerchant, Model model, RedirectAttributes redirectAttributes) throws Exception{
if (!beanValidator(model, hpIfaceMerchant)){
return form(hpIfaceMerchant, model);
}
//编辑表单保存
HpIfaceMerchant t = hpIfaceMerchantService.get(hpIfaceMerchant.getMerId());//从数据库取出记录的值
MyBeanUtils.copyBeanNotNull2Bean(hpIfaceMerchant, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
//查询地区信息
Area bean = areaService.get(hpIfaceMerchant.getOrgAddr().getId());
t.setOrgAddr(bean);
hpIfaceMerchantService.updateHpIfacemerchant(t);//保存
addMessage(redirectAttributes, "更新商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 删除商户
*/
@RequiresPermissions("interface:hpIfaceMerchant:del")
@RequestMapping(value = "delete")
public String delete(HpIfaceMerchant hpIfaceMerchant, RedirectAttributes redirectAttributes) {
hpIfaceMerchantService.delete(hpIfaceMerchant);
addMessage(redirectAttributes, "删除商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 批量删除商户
*/
@RequiresPermissions("interface:hpIfaceMerchant:del")
@RequestMapping(value = "deleteAll")
public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
String idArray[] =ids.split(",");
for(String id : idArray){
hpIfaceMerchantService.delete(hpIfaceMerchantService.get(id));
}
addMessage(redirectAttributes, "删除商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 导出excel文件
*/
@RequiresPermissions("interface:hpIfaceMerchant:export")
@RequestMapping(value = "export")
public String exportFile(HpIfaceMerchant hpIfaceMerchant, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = hpIfaceMerchant.getMerId()+".crt";
ByteArrayInputStream bais = new ByteArrayInputStream(hpIfaceMerchant.getDigitalKey().getBytes());
BufferedInputStream bis = new BufferedInputStream(bais);
OutputStream fos = response.getOutputStream();
BufferedOutputStream bos = new BufferedOutputStream(fos);
String result = "";
int byteRead = 0;
byte[] buffer = new byte[8192];
while((byteRead=bis.read(buffer,0,8192))!=-1){
bos.write(buffer,0,byteRead);
}
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
bos.flush();
bais.close();
bis.close();
fos.close();
bos.close();
// Page<HpIfaceMerchant> page = hpIfaceMerchantService.findPage(new Page<HpIfaceMerchant>(request, response, -1), hpIfaceMerchant);
// new ExportExcel("商户", HpIfaceMerchant.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出商户记录失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 导入Excel数据
*/
@RequiresPermissions("interface:hpIfaceMerchant:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
List<HpIfaceMerchant> list = ei.getDataList(HpIfaceMerchant.class);
for (HpIfaceMerchant hpIfaceMerchant : list){
try{
hpIfaceMerchantService.save(hpIfaceMerchant);
successNum++;
}catch(ConstraintViolationException ex){
failureNum++;
}catch (Exception ex) {
failureNum++;
}
}
if (failureNum>0){
failureMsg.insert(0, ",失败 "+failureNum+" 条商户记录。");
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条商户记录"+failureMsg);
} catch (Exception e) {
addMessage(redirectAttributes, "导入商户失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 下载导入商户数据模板
*/
@RequiresPermissions("interface:hpIfaceMerchant:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "商户数据导入模板.xlsx";
List<HpIfaceMerchant> list = Lists.newArrayList();
new ExportExcel("商户数据", HpIfaceMerchant.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
} | UTF-8 | Java | 10,602 | java | HpIfaceMerchantController.java | Java | [
{
"context": "ice.AreaService;\n\n/**\n * 商户管理Controller\n * @author gyp\n * @version 2016-06-14\n */\n@Controller\n@RequestMa",
"end": 1793,
"score": 0.9996252059936523,
"start": 1790,
"tag": "USERNAME",
"value": "gyp"
}
] | null | [] | /**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package com.healthpay.modules.iface.web;
import java.io.*;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import com.healthpay.common.utils.IdGen;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.h2.mvstore.DataUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.healthpay.common.utils.DateUtils;
import com.healthpay.common.utils.MyBeanUtils;
import com.healthpay.common.config.Global;
import com.healthpay.common.persistence.Page;
import com.healthpay.common.web.BaseController;
import com.healthpay.common.utils.StringUtils;
import com.healthpay.common.utils.excel.ExportExcel;
import com.healthpay.common.utils.excel.ImportExcel;
import com.healthpay.modules.iface.entity.HpIfaceMerchant;
import com.healthpay.modules.iface.service.HpIfaceMerchantService;
import com.healthpay.modules.sys.entity.Area;
import com.healthpay.modules.sys.service.AreaService;
/**
* 商户管理Controller
* @author gyp
* @version 2016-06-14
*/
@Controller
@RequestMapping(value = "${adminPath}/interface/hpIfaceMerchant")
public class HpIfaceMerchantController extends BaseController {
@Autowired
private HpIfaceMerchantService hpIfaceMerchantService;
@Autowired
private AreaService areaService;
@ModelAttribute
public HpIfaceMerchant get(@RequestParam(required=false) String merId) {
HpIfaceMerchant entity = null;
if (StringUtils.isNotBlank(merId)){
entity = hpIfaceMerchantService.get(merId);
}
if (entity == null){
entity = new HpIfaceMerchant();
}
return entity;
}
/**
* 商户列表页面
*/
@RequiresPermissions("interface:hpIfaceMerchant:list")
@RequestMapping(value = {"list", ""})
public String list(HpIfaceMerchant hpIfaceMerchant, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<HpIfaceMerchant> page = hpIfaceMerchantService.findPage(new Page<HpIfaceMerchant>(request, response), hpIfaceMerchant);
model.addAttribute("page", page);
return "modules/iface/hpIfaceMerchantList";
}
/**
* 查看,增加,编辑商户表单页面
*/
@RequiresPermissions(value={"interface:hpIfaceMerchant:view","interface:hpIfaceMerchant:add","interface:hpIfaceMerchant:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(HpIfaceMerchant hpIfaceMerchant, Model model) {
model.addAttribute("hpIfaceMerchant", hpIfaceMerchant);
return "modules/iface/hpIfaceMerchantForm";
}
/**
* 增加商户表单页面
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:add",logical=Logical.OR)
@RequestMapping(value = "addForm")
public String addForm(HpIfaceMerchant hpIfaceMerchant, Model model) {
model.addAttribute("hpIfaceMerchant", hpIfaceMerchant);
return "modules/iface/hpIfaceMerchantAddForm";
}
/**
* 保存商户
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:add",logical=Logical.OR)
@RequestMapping(value = "saveHpIfaceMerchant")
public String saveHpIfaceMerchant(HpIfaceMerchant hpIfaceMerchant, Model model, RedirectAttributes redirectAttributes) throws Exception{
if (!beanValidator(model, hpIfaceMerchant)){
return form(hpIfaceMerchant, model);
}
HpIfaceMerchant merchant=hpIfaceMerchantService.getMerchantByOrgCode(hpIfaceMerchant.getOrgCode());
if(null !=merchant){
addMessage(redirectAttributes, "该机构已存在!");
}else{
//新增表单保存
hpIfaceMerchant.setIsNewRecord(true);
hpIfaceMerchant.setStatus("1");
hpIfaceMerchant.setMerType("1");
//查询地区信息
Area bean = areaService.get(hpIfaceMerchant.getOrgAddr().getId());
hpIfaceMerchant.setOrgAddr(bean);
hpIfaceMerchantService.saveHpIfaceMerchant(hpIfaceMerchant);//保存
addMessage(redirectAttributes, "保存商户成功");
}
/*HpIfaceMerchant t = hpIfaceMerchantService.get(hpIfaceMerchant.getMerId());//从数据库取出记录的值
if(null!=t){
addMessage(redirectAttributes, "该商户号已存在!");
}else{
//新增表单保存
hpIfaceMerchant.setIsNewRecord(true);
hpIfaceMerchant.setStatus("1");
hpIfaceMerchant.setMerType("1");
//hpIfaceMerchant.setMerId(IdGen.generateNumber());
//hpIfaceMerchant.setDigitalKey(StringUtils.getStringRandom(64));
hpIfaceMerchantService.saveHpIfaceMerchant(hpIfaceMerchant);//保存
addMessage(redirectAttributes, "保存商户成功");
}*/
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 更新商户
*/
@RequiresPermissions(value="interface:hpIfaceMerchant:edit",logical=Logical.OR)
@RequestMapping(value = "updateHpIfacemerchant")
public String updateHpIfacemerchant(HpIfaceMerchant hpIfaceMerchant, Model model, RedirectAttributes redirectAttributes) throws Exception{
if (!beanValidator(model, hpIfaceMerchant)){
return form(hpIfaceMerchant, model);
}
//编辑表单保存
HpIfaceMerchant t = hpIfaceMerchantService.get(hpIfaceMerchant.getMerId());//从数据库取出记录的值
MyBeanUtils.copyBeanNotNull2Bean(hpIfaceMerchant, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
//查询地区信息
Area bean = areaService.get(hpIfaceMerchant.getOrgAddr().getId());
t.setOrgAddr(bean);
hpIfaceMerchantService.updateHpIfacemerchant(t);//保存
addMessage(redirectAttributes, "更新商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 删除商户
*/
@RequiresPermissions("interface:hpIfaceMerchant:del")
@RequestMapping(value = "delete")
public String delete(HpIfaceMerchant hpIfaceMerchant, RedirectAttributes redirectAttributes) {
hpIfaceMerchantService.delete(hpIfaceMerchant);
addMessage(redirectAttributes, "删除商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 批量删除商户
*/
@RequiresPermissions("interface:hpIfaceMerchant:del")
@RequestMapping(value = "deleteAll")
public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
String idArray[] =ids.split(",");
for(String id : idArray){
hpIfaceMerchantService.delete(hpIfaceMerchantService.get(id));
}
addMessage(redirectAttributes, "删除商户成功");
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 导出excel文件
*/
@RequiresPermissions("interface:hpIfaceMerchant:export")
@RequestMapping(value = "export")
public String exportFile(HpIfaceMerchant hpIfaceMerchant, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = hpIfaceMerchant.getMerId()+".crt";
ByteArrayInputStream bais = new ByteArrayInputStream(hpIfaceMerchant.getDigitalKey().getBytes());
BufferedInputStream bis = new BufferedInputStream(bais);
OutputStream fos = response.getOutputStream();
BufferedOutputStream bos = new BufferedOutputStream(fos);
String result = "";
int byteRead = 0;
byte[] buffer = new byte[8192];
while((byteRead=bis.read(buffer,0,8192))!=-1){
bos.write(buffer,0,byteRead);
}
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
bos.flush();
bais.close();
bis.close();
fos.close();
bos.close();
// Page<HpIfaceMerchant> page = hpIfaceMerchantService.findPage(new Page<HpIfaceMerchant>(request, response, -1), hpIfaceMerchant);
// new ExportExcel("商户", HpIfaceMerchant.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出商户记录失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 导入Excel数据
*/
@RequiresPermissions("interface:hpIfaceMerchant:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
int failureNum = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
List<HpIfaceMerchant> list = ei.getDataList(HpIfaceMerchant.class);
for (HpIfaceMerchant hpIfaceMerchant : list){
try{
hpIfaceMerchantService.save(hpIfaceMerchant);
successNum++;
}catch(ConstraintViolationException ex){
failureNum++;
}catch (Exception ex) {
failureNum++;
}
}
if (failureNum>0){
failureMsg.insert(0, ",失败 "+failureNum+" 条商户记录。");
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条商户记录"+failureMsg);
} catch (Exception e) {
addMessage(redirectAttributes, "导入商户失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
/**
* 下载导入商户数据模板
*/
@RequiresPermissions("interface:hpIfaceMerchant:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "商户数据导入模板.xlsx";
List<HpIfaceMerchant> list = Lists.newArrayList();
new ExportExcel("商户数据", HpIfaceMerchant.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/interface/hpIfaceMerchant/?repage";
}
} | 10,602 | 0.747222 | 0.742857 | 273 | 35.926739 | 32.677383 | 160 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.970696 | false | false | 14 |
71965eb0986a91429f552ba82240b81b088eab5e | 6,880,537,619,775 | 72192c35130cf928e273dd0906d3da6124212624 | /project-base/src/main/java/cn/annpeter/graduation/project/base/common/model/ResultCodeEnum.java | 0270acba49de54eb4e0d8c7c0b050142eb0bef33 | [] | no_license | annpeter/graduation-project | https://github.com/annpeter/graduation-project | f720abb68879ef7e87479ebf5cd226059b4e7172 | a49fc69e6424bff33ab8ef8a9b6a8ed2865ca775 | refs/heads/master | 2020-05-22T16:10:46.419000 | 2017-05-28T13:51:03 | 2017-05-28T13:51:03 | 84,702,486 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.annpeter.graduation.project.base.common.model;
/**
* Created on 2017/03/10
*
* @author annpeter.it@gmail.com
*/
public enum ResultCodeEnum {
SUCCESS(200, "执行成功"),
UPLOAD_OSS_ERROR(300, "上传OSS失败"),
USER_NOT_LOGIN(400, "用户未登录"),
FORBIDDEN(403, "权限不足"),
RESOURCE_NOT_FOUND(404, "资源未找到"),
RESOURCE_CONFLICT(409, "资源冲突"),
REQUEST_PARAM_ERROR(412, "参数错误"),
PRECONDITION_FAILED(428, "要求先决条件"),
UNKNOWN_ERROR(500, "未知错误"),
SERVER_POWER_LESS(501, "服务器无法完成该请求");
private Integer code;
private String msg;
ResultCodeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
| UTF-8 | Java | 881 | java | ResultCodeEnum.java | Java | [
{
"context": "model;\n\n/**\n * Created on 2017/03/10\n *\n * @author annpeter.it@gmail.com\n */\npublic enum ResultCodeEnum {\n SUCCESS(200,",
"end": 123,
"score": 0.9999277591705322,
"start": 102,
"tag": "EMAIL",
"value": "annpeter.it@gmail.com"
}
] | null | [] | package cn.annpeter.graduation.project.base.common.model;
/**
* Created on 2017/03/10
*
* @author <EMAIL>
*/
public enum ResultCodeEnum {
SUCCESS(200, "执行成功"),
UPLOAD_OSS_ERROR(300, "上传OSS失败"),
USER_NOT_LOGIN(400, "用户未登录"),
FORBIDDEN(403, "权限不足"),
RESOURCE_NOT_FOUND(404, "资源未找到"),
RESOURCE_CONFLICT(409, "资源冲突"),
REQUEST_PARAM_ERROR(412, "参数错误"),
PRECONDITION_FAILED(428, "要求先决条件"),
UNKNOWN_ERROR(500, "未知错误"),
SERVER_POWER_LESS(501, "服务器无法完成该请求");
private Integer code;
private String msg;
ResultCodeEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
| 867 | 0.614597 | 0.565941 | 35 | 21.314285 | 15.709454 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false | 14 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.