ui updates
Showing
6 changed files
with
55 additions
and
10 deletions
| ... | @@ -9999,6 +9999,10 @@ p.intro { | ... | @@ -9999,6 +9999,10 @@ p.intro { |
| 9999 | flex: 1; | 9999 | flex: 1; |
| 10000 | } | 10000 | } |
| 10001 | 10001 | ||
| 10002 | pre { | ||
| 10003 | line-height: 0 !important; | ||
| 10004 | } | ||
| 10005 | |||
| 10002 | .logout-btn { | 10006 | .logout-btn { |
| 10003 | background: #76BC21; | 10007 | background: #76BC21; |
| 10004 | display: block; | 10008 | display: block; | ... | ... |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
| ... | @@ -19,6 +19,8 @@ if ( class_exists( 'WP_CLI' ) ) { | ... | @@ -19,6 +19,8 @@ if ( class_exists( 'WP_CLI' ) ) { |
| 19 | } | 19 | } |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | // var_dump($staff_members);exit; | ||
| 23 | |||
| 22 | // if(count($staff_members) > 0) { | 24 | // if(count($staff_members) > 0) { |
| 23 | 25 | ||
| 24 | // $assignments = get_fields('options')['assignments']; | 26 | // $assignments = get_fields('options')['assignments']; |
| ... | @@ -37,12 +39,15 @@ if ( class_exists( 'WP_CLI' ) ) { | ... | @@ -37,12 +39,15 @@ if ( class_exists( 'WP_CLI' ) ) { |
| 37 | 39 | ||
| 38 | // $current_assignment_count = get_option('options_assignments'); | 40 | // $current_assignment_count = get_option('options_assignments'); |
| 39 | $iter_counter = 0; | 41 | $iter_counter = 0; |
| 42 | // var_dump($staff_members);exit; | ||
| 40 | foreach($staff_members as $assign) { | 43 | foreach($staff_members as $assign) { |
| 41 | 44 | ||
| 42 | if(!empty($assign['ext'])) { | 45 | if(!empty($assign['ext'])) { |
| 43 | $assign['phone'] = $assign['phone'].' #'.$assign['ext']; | 46 | $assign['phone'] = $assign['phone'].' #'.$assign['ext']; |
| 44 | } | 47 | } |
| 45 | 48 | ||
| 49 | $save_options_data = []; | ||
| 50 | |||
| 46 | foreach($field_keys as $fk) { | 51 | foreach($field_keys as $fk) { |
| 47 | 52 | ||
| 48 | $option_name = 'options_assignments_'.$iter_counter."_".$fk['name']; | 53 | $option_name = 'options_assignments_'.$iter_counter."_".$fk['name']; |
| ... | @@ -79,27 +84,59 @@ if ( class_exists( 'WP_CLI' ) ) { | ... | @@ -79,27 +84,59 @@ if ( class_exists( 'WP_CLI' ) ) { |
| 79 | $assign['sub_category'] = str_replace('#', '',$assign['sub_category']); | 84 | $assign['sub_category'] = str_replace('#', '',$assign['sub_category']); |
| 80 | $assign['sub_category'] = str_replace('/', '',$assign['sub_category']); | 85 | $assign['sub_category'] = str_replace('/', '',$assign['sub_category']); |
| 81 | 86 | ||
| 82 | 87 | if($assign['sub_category'] && $assign['sub_category'] != 'na') { | |
| 83 | if($sub_cat == 'farm team #1' || $sub_cat == 'farm team #2' || $sub_cat == 'commercial team #1' || $sub_cat == 'commercial team #2' || $sub_cat == 'commercial team #3') { | ||
| 84 | $sub_cat_assignments[$sub_cat] = $option_value; | 88 | $sub_cat_assignments[$sub_cat] = $option_value; |
| 89 | $option_value = []; | ||
| 90 | } | ||
| 91 | |||
| 92 | } | ||
| 93 | |||
| 94 | if($fk['name'] == 'sub_category' && !empty($option_value)) { | ||
| 95 | |||
| 96 | $sub_cat = trim($assign['sub_category']); | ||
| 97 | |||
| 98 | $assign['sub_category'] = str_replace(' ', '_',$assign['sub_category']); | ||
| 99 | $assign['sub_category'] = str_replace('#', '',$assign['sub_category']); | ||
| 100 | $assign['sub_category'] = str_replace('/', '',$assign['sub_category']); | ||
| 101 | |||
| 102 | $sub_cat_name_matcher = [ | ||
| 103 | 'farm_team_1' => 'farm_1', | ||
| 104 | 'farm_team_2' => 'farm_2', | ||
| 105 | 'commercial_team_1' => 'comm_1', | ||
| 106 | 'commercial_team_2' => 'comm_2', | ||
| 107 | 'commercial_team_3' => 'comm_3', | ||
| 108 | ]; | ||
| 109 | |||
| 110 | if(isset($sub_cat_name_matcher[ $assign['sub_category']])) { | ||
| 111 | $assign['sub_category'] = $sub_cat_name_matcher[ $assign['sub_category']]; | ||
| 85 | } | 112 | } |
| 86 | 113 | ||
| 114 | $option_value = $assign['sub_category']; | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 87 | } | 118 | } |
| 88 | 119 | ||
| 89 | update_option($option_name, $option_value); | 120 | $save_options_data[$fk['name']] = ['option_name'=>$option_name,'option_value'=>$option_value]; |
| 90 | update_option($option_name_key, $option_value_key); | 121 | |
| 91 | } | 122 | } |
| 123 | |||
| 124 | foreach($save_options_data as $sod) { | ||
| 125 | // var_dump($sod['option_name'] . " === " . $sod['option_value']); | ||
| 126 | update_option($sod['option_name'], $sod['option_value']); | ||
| 127 | } | ||
| 128 | |||
| 92 | // var_dump( $assign); | 129 | // var_dump( $assign); |
| 93 | ++$iter_counter; | 130 | ++$iter_counter; |
| 94 | 131 | ||
| 95 | } | 132 | } |
| 96 | 133 | ||
| 97 | // var_dump( $sub_cat_assignments['commercial team #1']);exit; | 134 | // var_dump( $sub_cat_assignments);exit; |
| 98 | update_option('options_farm_1_broker_assignment', $sub_cat_assignments['farm team #1']); | 135 | update_option('options_farm_1_broker_assignment', $sub_cat_assignments['farm_1']); |
| 99 | update_option('options_farm_2_broker_assignment', $sub_cat_assignments['farm team #2']); | 136 | update_option('options_farm_2_broker_assignment', $sub_cat_assignments['farm_2']); |
| 100 | update_option('options_comm_1_broker_assignment', $sub_cat_assignments['commercial team #1']); | 137 | update_option('options_comm_1_broker_assignment', $sub_cat_assignments['comm_1']); |
| 101 | update_option('options_comm_2_broker_assignment', $sub_cat_assignments['commercial team #2']); | 138 | update_option('options_comm_2_broker_assignment', $sub_cat_assignments['comm_2']); |
| 102 | update_option('options_comm_3_broker_assignment', $sub_cat_assignments['commercial team #3']); | 139 | update_option('options_comm_3_broker_assignment', $sub_cat_assignments['comm_3']); |
| 103 | 140 | ||
| 104 | //a:1:{i:0;s:5:"73040";} | 141 | //a:1:{i:0;s:5:"73040";} |
| 105 | //s:452:"a:35:{i:0;i:73040;i:1;i:73044;i:2;i:73045;i:3;i:73046;i:4;i:73047;i:5;i:73050;i:6;i:73051;i:7;i:73053;i:8;i:73057;i:9;i:73058;i:10;i:73061;i:11;i:73064;i:12;i:73066;i:13;i:73067;i:14;i:73070;i:15;i:73071;i:16;i:73072;i:17;i:73074;i:18;i:73076;i:19;i:73083;i:20;i:73086;i:21;i:73087;i:22;i:73088;i:23;i:73089;i:24;i:73090;i:25;i:73092;i:26;i:73094;i:27;i:73095;i:28;i:73098;i:29;i:73099;i:30;i:73100;i:31;i:73102;i:32;i:73103;i:33;i:73106;i:34;i:73110;}"; | 142 | //s:452:"a:35:{i:0;i:73040;i:1;i:73044;i:2;i:73045;i:3;i:73046;i:4;i:73047;i:5;i:73050;i:6;i:73051;i:7;i:73053;i:8;i:73057;i:9;i:73058;i:10;i:73061;i:11;i:73064;i:12;i:73066;i:13;i:73067;i:14;i:73070;i:15;i:73071;i:16;i:73072;i:17;i:73074;i:18;i:73076;i:19;i:73083;i:20;i:73086;i:21;i:73087;i:22;i:73088;i:23;i:73089;i:24;i:73090;i:25;i:73092;i:26;i:73094;i:27;i:73095;i:28;i:73098;i:29;i:73099;i:30;i:73100;i:31;i:73102;i:32;i:73103;i:33;i:73106;i:34;i:73110;}"; | ... | ... |
-
Please register or sign in to post a comment