File manager - Edit - /home/aussies6/public_html/seafoodwarehouse.com.au/wp-content/plugins/ByConsoleWooODTExtended/inc/wooodt_delivery_pickup_van_management_settings.php
Back
<?php function byconsolewooodt_admin_delivery_pickup_van_management_settings_form() { ?> <div class="wrap"> <h1>ByConsole van management settings pannel</h1> <?php $delivery_per_custom_slot_array = get_option('delivery_per_custom_slot'); //print_r($delivery_per_custom_slot_array); foreach($delivery_per_custom_slot_array as $delivery_per_custom_slot_key => $delivery_per_custom_slot_val) { //print_r($delivery_per_custom_slot_val); //echo '<hr />'; $delivery_per_custom_slot_val['time_slot']; //echo '<hr />'; foreach($delivery_per_custom_slot_val as $delivery_per_custom_slot_val_single_key => $delivery_per_custom_slot_val_single_value) { $delivery_time_array_value[] = $delivery_per_custom_slot_val_single_value['time_slot']; } } //print_r($delivery_time_array_value); ?> <form method="post" class="form_byconsolewooodt_plugin_settings" action="options.php"> <?php settings_fields("vanmanagementsection"); do_settings_sections("byconsolewooodt_vanmanagement_setting_options"); submit_button(); ?> </form> </div> <?php } function byconsolewooodt_delivery_per_custom_slot_confirm_box() { ?> <input type="checkbox" name="byconsolewooodt_delivery_per_custom_slot_confirm_box" id="byconsolewooodt_delivery_per_custom_slot_confirm_box" value="yes" <?php if(get_option('byconsolewooodt_delivery_per_custom_slot_confirm_box') == 'yes'){ echo 'checked="checked"';}?> style="float: left;width: 15px;" /> <?php } // For Pickup function byconsolewooodt_pickup_per_custom_slot() { $byconsolewooodt_pickup_location_for_count = get_option('byconsolewooodt_pickup_location'); foreach($byconsolewooodt_pickup_location_for_count as $byconsolewooodt_pickup_location_for_count_key => $byconsolewooodt_pickup_location_for_count_val) { $byconsolewooodt_pickup_location_for_count_key_value[]=$byconsolewooodt_pickup_location_for_count_key; } //print_r($byconsolewooodt_pickup_location_for_count_key_value); ?> <script type="text/javascript" language="javascript"> /*jQuery(document).ready(function(){ jQuery("#btn_pickup_per_custom_slot_add_another").click(function(){ alert(); }); }); */ jQuery(document).ready(function(){ if (jQuery("#byconsolewooodt_pickup_per_custom_slot_confirm_box").is(':checked')) { jQuery(".time_slot_per_location").css("display","block"); } else { jQuery(".time_slot_per_location").css("display","none"); } jQuery("#byconsolewooodt_pickup_per_custom_slot_confirm_box").change(function(event){ if (this.checked){ jQuery(".time_slot_per_location").slideDown(); } else { jQuery(".time_slot_per_location").slideUp(); } }); }); function get_start_timeslot_textbox_details($starttimeslotdetails) { //alert("1"); var custom_start_timeslot_textbox_className = $starttimeslotdetails.className; var custom_start_timeslot_textbox_value = $starttimeslotdetails.value; jQuery('.'+custom_start_timeslot_textbox_className).val(custom_start_timeslot_textbox_value); } function get_end_timeslot_textbox_details($endtimeslotdetails) { //alert("1"); var custom_end_timeslot_textbox_className = $endtimeslotdetails.className; var custom_end_timeslot_textbox_value = $endtimeslotdetails.value; jQuery('.'+custom_end_timeslot_textbox_className).val(custom_end_timeslot_textbox_value); } function get_numberofpickup_textbox_details($numberofpickupdetails) { //alert("2"); var custom_numberofpickup_textbox_className = $numberofpickupdetails.className; var custom_numberofpickup_textbox_value = $numberofpickupdetails.value; jQuery('.'+custom_numberofpickup_textbox_className).val(custom_numberofpickup_textbox_value); //alert(custom_numberofpickup_textbox_value); } function pickup_per_custom_slot_add_another($this) { var btn_pickup_per_custom_slot_add_another_className = $this.className; var n_numTab = jQuery("ul."+btn_pickup_per_custom_slot_add_another_className).children().length; //alert(n_numTab); if(n_numTab == 1) { n_numTabs = n_numTab; } else { n_numTabs = n_numTab+1; } //alert(n_numTabs-1); //n_numTabs++; //alert(n_numTabs); var btn_pickup_per_custom_slot_add_another_className_split = btn_pickup_per_custom_slot_add_another_className.split("_"); var byconsolewooodt_pickup_per_custom_slot_count = <?php if (empty($byconsolewooodt_pickup_location_for_count_key_value)){ echo '0' ;} else { echo end($byconsolewooodt_pickup_location_for_count_key_value); }?>; //alert(byconsolewooodt_pickup_per_custom_slot_count); byconsolewooodt_pickup_per_custom_slot_count++; //alert(byconsolewooodt_pickup_per_custom_slot_count); //alert(btn_pickup_per_custom_slot_add_another_className_split); jQuery('.'+btn_pickup_per_custom_slot_add_another_className).append('<li class="" id="child_slot"><div class="custom_slot_container'+btn_pickup_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'" style="width: 55%;float: right; margin-bottom: 10px; margin-top: -5px;"><input type="time" name="pickup_per_custom_slot['+parseInt(btn_pickup_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][start_time_slot]" class="pickup_per_custom_slot_'+btn_pickup_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_start_time_slot" value="" onChange="get_start_timeslot_textbox_details(this);" style="margin-right: 18px;" /><input type="time" name="pickup_per_custom_slot['+parseInt(btn_pickup_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][end_time_slot]" class="pickup_per_custom_slot_'+btn_pickup_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_end_time_slot" value="" onChange="get_end_timeslot_textbox_details(this);" style="margin-right: 18px;" /><input type="text" name="pickup_per_custom_slot['+parseInt(btn_pickup_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][number_of_delivery]" class="pickup_per_custom_slot_'+btn_pickup_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_number_of_pickup" value="" onChange="get_numberofpickup_textbox_details(this);" style="margin-right: 10px;width: 25%;" /><span id="del_custom_slot" class="" style="cursor:pointer;background-color:#000;color:#fff;padding:3px;" >X</span></div></li>'); } </script> <?php $byconsolewooodt_pickup_location = get_option('byconsolewooodt_pickup_location'); if(!empty($byconsolewooodt_pickup_location)) { echo '<div class="time_slot_per_location"> <div style="width: 90%; height: 30px; clear: both;padding: 10px 10px 0px 10px;color: #000; background-color:rgba(204, 204, 204, 0.52);"> <div style="width: 49%; float: left;"><b>Location</b></div> <div style="width: 17%; float: left;"><b>Start Time Slot</b></div> <div style="width: 15%; float: left;"><b>End Time Slot</b></div> <div style="width: 18%; float: right;"><b>Number Of Delivery</b></div> </div>'; $slot=1; foreach($byconsolewooodt_pickup_location as $byconsolewooodt_pickup_location_single_key => $byconsolewooodt_pickup_location_single_val) { ?> <div style="width:100%; height: auto;clear: both;"> <div style="width: 45%; float: left; height:250px;"> <b><?php echo $byconsolewooodt_pickup_location_single_val['location']; ?></b> </div> <?php $pickup_per_custom_slot_array = get_option('pickup_per_custom_slot'); $pickup_per_custom_slot_fetched_array = $pickup_per_custom_slot_array[$byconsolewooodt_pickup_location_single_key]; //echo '<hr />'; if(!empty($pickup_per_custom_slot_fetched_array)) { ?> <ul class="pickup_per_custom_slot_add_another_<?php echo $byconsolewooodt_pickup_location_single_key;?>"> <?php foreach( $pickup_per_custom_slot_fetched_array as $pickup_per_custom_slot_fetched_sots_key => $pickup_per_custom_slot_fetched_sots){ //echo $pickup_per_custom_slot_fetched_sots_key; //echo '<br />'; ?> <li class=""> <div class="custom_slot_container_<?php echo $byconsolewooodt_pickup_location_single_key;?>_<?php echo $pickup_per_custom_slot_fetched_sots_key;?>" style="width: 50%;float: left;"> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="time" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][<?php echo $pickup_per_custom_slot_fetched_sots_key;?>][start_time_slot]" id="pickup_per_custom_slot" value="<?php echo $pickup_per_custom_slot_fetched_sots['start_time_slot']?>" /> </div> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="time" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][<?php echo $pickup_per_custom_slot_fetched_sots_key;?>][end_time_slot]" id="pickup_per_custom_slot" value="<?php echo $pickup_per_custom_slot_fetched_sots['end_time_slot']?>" /> </div> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="text" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][<?php echo $pickup_per_custom_slot_fetched_sots_key;?>][number_of_delivery]" id="pickup_per_custom_slot" value="<?php echo $pickup_per_custom_slot_fetched_sots['number_of_delivery']?>" style="width: 90%;" /> </div> <span id="del_custom_slot" class="" style="cursor:pointer; background-color:#000;color:#fff;padding:3px;">X</span> </div> </li> <?php } ?> <?php } else { ?> <li> <div style="width: 15%; float: left;"> <input type="time" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][0][time_slot]" id="pickup_per_custom_slot" value="" /> </div> <div style="width: 15%; float: left;"> <input type="time" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][0][number_of_delivery]" id="pickup_per_custom_slot" value="" /> </div> <div style="width: 15%; float: left;"> <input type="text" name="pickup_per_custom_slot[<?php echo $byconsolewooodt_pickup_location_single_key;?>][0][number_of_delivery]" id="pickup_per_custom_slot" value="" style="width: 90%;" /> </div> </li> <?php }?> </ul> <!--ul class="pickup_per_custom_slot_add_another_<?php // echo $byconsolewooodt_pickup_location_single_key;?>"></ul--> <div class="fldst"> <input type="button" id="btn_pickup_per_custom_slot_add_another" class="pickup_per_custom_slot_add_another_<?php echo $byconsolewooodt_pickup_location_single_key;?>" value="Add" onclick="pickup_per_custom_slot_add_another(this)"> </div> </div> <hr/> <?php $slot++; } echo '</div>'; } } // For Delivery... function byconsolewooodt_delivery_per_custom_slot() { $byconsolewooodt_delivery_location_for_count = get_option('byconsolewooodt_delivery_location'); foreach($byconsolewooodt_delivery_location_for_count as $byconsolewooodt_delivery_location_for_count_key => $byconsolewooodt_delivery_location_for_count_val) { $byconsolewooodt_delivery_location_for_count_key_value[]=$byconsolewooodt_delivery_location_for_count_key; } //print_r($byconsolewooodt_delivery_location_for_count_key_value); ?> <script type="text/javascript" language="javascript"> /*jQuery(document).ready(function(){ jQuery("#btn_delivery_per_custom_slot_add_another").click(function(){ alert(); }); }); */ jQuery(document).ready(function(){ if (jQuery("#byconsolewooodt_delivery_per_custom_slot_confirm_box").is(':checked')) { jQuery(".time_slot_per_location").css("display","block"); } else { jQuery(".time_slot_per_location").css("display","none"); } jQuery("#byconsolewooodt_delivery_per_custom_slot_confirm_box").change(function(event){ if (this.checked){ jQuery(".time_slot_per_location").slideDown(); } else { jQuery(".time_slot_per_location").slideUp(); } }); }); function get_start_timeslot_textbox_details($starttimeslotdetails) { //alert("1"); var custom_start_timeslot_textbox_className = $starttimeslotdetails.className; var custom_start_timeslot_textbox_value = $starttimeslotdetails.value; jQuery('.'+custom_start_timeslot_textbox_className).val(custom_start_timeslot_textbox_value); } function get_end_timeslot_textbox_details($endtimeslotdetails) { //alert("1"); var custom_end_timeslot_textbox_className = $endtimeslotdetails.className; var custom_end_timeslot_textbox_value = $endtimeslotdetails.value; jQuery('.'+custom_end_timeslot_textbox_className).val(custom_end_timeslot_textbox_value); } function get_numberofdelivery_textbox_details($numberofdeliverydetails) { //alert("2"); var custom_numberofdelivery_textbox_className = $numberofdeliverydetails.className; var custom_numberofdelivery_textbox_value = $numberofdeliverydetails.value; jQuery('.'+custom_numberofdelivery_textbox_className).val(custom_numberofdelivery_textbox_value); //alert(custom_numberofdelivery_textbox_value); } function delivery_per_custom_slot_add_another($this){ var btn_delivery_per_custom_slot_add_another_className = $this.className; var n_numTab = jQuery("ul."+btn_delivery_per_custom_slot_add_another_className).children().length; //alert(n_numTab); if(n_numTab == 1) { n_numTabs = n_numTab; } else { n_numTabs = n_numTab+1; } //alert(n_numTabs-1); //n_numTabs++; //alert(n_numTabs); var btn_delivery_per_custom_slot_add_another_className_split = btn_delivery_per_custom_slot_add_another_className.split("_"); var byconsolewooodt_delivery_per_custom_slot_count = <?php if (empty($byconsolewooodt_delivery_location_for_count_key_value)){ echo '0' ;} else { echo end($byconsolewooodt_delivery_location_for_count_key_value); }?>; //alert(byconsolewooodt_delivery_per_custom_slot_count); byconsolewooodt_delivery_per_custom_slot_count++; //alert(byconsolewooodt_delivery_per_custom_slot_count); //alert(btn_delivery_per_custom_slot_add_another_className_split); jQuery('.'+btn_delivery_per_custom_slot_add_another_className).append('<li class="" id="child_slot"><div class="custom_slot_container'+btn_delivery_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'" style="width: 55%;float: right; margin-bottom: 10px; margin-top: -5px;"><input type="time" name="delivery_per_custom_slot['+parseInt(btn_delivery_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][start_time_slot]" class="delivery_per_custom_slot_'+btn_delivery_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_start_time_slot" value="" onChange="get_start_timeslot_textbox_details(this);" style="margin-right: 18px;" /><input type="time" name="delivery_per_custom_slot['+parseInt(btn_delivery_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][end_time_slot]" class="delivery_per_custom_slot_'+btn_delivery_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_end_time_slot" value="" onChange="get_end_timeslot_textbox_details(this);" style="margin-right: 18px;" /><input type="text" name="delivery_per_custom_slot['+parseInt(btn_delivery_per_custom_slot_add_another_className_split[6])+']['+n_numTabs+'][number_of_delivery]" class="delivery_per_custom_slot_'+btn_delivery_per_custom_slot_add_another_className_split[6]+'_'+n_numTabs+'_number_of_delivery" value="" onChange="get_numberofdelivery_textbox_details(this);" style="margin-right: 10px;width: 25%;" /><span id="del_custom_slot" class="" style="cursor:pointer;background-color:#000;color:#fff;padding:3px;" >X</span></div></li>'); } </script> <?php $byconsolewooodt_delivery_location = get_option('byconsolewooodt_delivery_location'); if(!empty($byconsolewooodt_delivery_location)) { echo '<div class="time_slot_per_location"> <div style="width: 90%; height: 30px; clear: both;padding: 10px 10px 0px 10px;color: #000; background-color:rgba(204, 204, 204, 0.52);"> <div style="width: 49%; float: left;"><b>Location</b></div> <div style="width: 17%; float: left;"><b>Start Time Slot</b></div> <div style="width: 15%; float: left;"><b>End Time Slot</b></div> <div style="width: 18%; float: right;"><b>Number Of Delivery</b></div> </div>'; $slot=1; foreach($byconsolewooodt_delivery_location as $byconsolewooodt_delivery_location_single_key => $byconsolewooodt_delivery_location_single_val) { ?> <div style="width:100%; height: auto;clear: both;"> <div style="width: 45%; float: left; height:250px;"> <b><?php echo $byconsolewooodt_delivery_location_single_val['location']; ?></b> </div> <?php $delivery_per_custom_slot_array = get_option('delivery_per_custom_slot'); $delivery_per_custom_slot_fetched_array = $delivery_per_custom_slot_array[$byconsolewooodt_delivery_location_single_key]; //print_r($delivery_per_custom_slot_fetched_array); //echo '<hr />'; if(!empty($delivery_per_custom_slot_fetched_array)) { ?> <ul class="delivery_per_custom_slot_add_another_<?php echo $byconsolewooodt_delivery_location_single_key;?>"> <?php foreach( $delivery_per_custom_slot_fetched_array as $delivery_per_custom_slot_fetched_sots_key => $delivery_per_custom_slot_fetched_sots){ //echo $delivery_per_custom_slot_fetched_sots_key; //echo '<br />'; ?> <li class=""> <div class="custom_slot_container_<?php echo $byconsolewooodt_delivery_location_single_key;?>_<?php echo $delivery_per_custom_slot_fetched_sots_key;?>" style="width: 50%;float: left;"> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="time" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][<?php echo $delivery_per_custom_slot_fetched_sots_key;?>][start_time_slot]" id="delivery_per_custom_slot" value="<?php echo $delivery_per_custom_slot_fetched_sots['start_time_slot']?>" /> </div> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="time" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][<?php echo $delivery_per_custom_slot_fetched_sots_key;?>][end_time_slot]" id="delivery_per_custom_slot" value="<?php echo $delivery_per_custom_slot_fetched_sots['end_time_slot']?>" /> </div> <div style="width: 30%; float: left; margin-top: -5px; margin-bottom: 10px;"> <input type="text" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][<?php echo $delivery_per_custom_slot_fetched_sots_key;?>][number_of_delivery]" id="delivery_per_custom_slot" value="<?php echo $delivery_per_custom_slot_fetched_sots['number_of_delivery']?>" style="width: 90%;" /> </div> <span id="del_custom_slot" class="" style="cursor:pointer; background-color:#000;color:#fff;padding:3px;">X</span> </div> </li> <?php } ?> <?php } else { ?> <li> <div style="width: 15%; float: left;"> <input type="time" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][0][time_slot]" id="delivery_per_custom_slot" value="" /> </div> <div style="width: 15%; float: left;"> <input type="time" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][0][number_of_delivery]" id="delivery_per_custom_slot" value="" /> </div> <div style="width: 15%; float: left;"> <input type="text" name="delivery_per_custom_slot[<?php echo $byconsolewooodt_delivery_location_single_key;?>][0][number_of_delivery]" id="delivery_per_custom_slot" value="" style="width: 90%;" /> </div> </li> <?php }?> </ul> <!--ul class="delivery_per_custom_slot_add_another_<?php // echo $byconsolewooodt_delivery_location_single_key;?>"></ul--> <div class="fldst"> <input type="button" id="btn_delivery_per_custom_slot_add_another" class="delivery_per_custom_slot_add_another_<?php echo $byconsolewooodt_delivery_location_single_key;?>" value="Add" onclick="delivery_per_custom_slot_add_another(this)"> </div> </div> <hr/> <?php $slot++; } echo '</div>'; } } add_action('admin_init', 'byconsolewooodt_delivery_per_custom_slot_settings_fields'); function byconsolewooodt_delivery_per_custom_slot_settings_fields() { add_settings_section("vanmanagementsection", "Van Management Settings", null, "byconsolewooodt_vanmanagement_setting_options"); add_settings_field("byconsolewooodt_delivery_per_custom_slot_confirm_box", "Enable custom slot:<p style='color: #999;'>( This will remove the default time slot and populate your custom timing and this will be same for all days ) </p>", "byconsolewooodt_delivery_per_custom_slot_confirm_box", "byconsolewooodt_vanmanagement_setting_options", "vanmanagementsection"); add_settings_field("pickup_per_custom_slot", "Pick Up Location:", "byconsolewooodt_pickup_per_custom_slot", "byconsolewooodt_vanmanagement_setting_options", "vanmanagementsection"); add_settings_field("delivery_per_custom_slot", "Delivery Location:", "byconsolewooodt_delivery_per_custom_slot", "byconsolewooodt_vanmanagement_setting_options", "vanmanagementsection"); register_setting("vanmanagementsection", "byconsolewooodt_delivery_per_custom_slot_confirm_box"); register_setting("vanmanagementsection", "pickup_per_custom_slot"); register_setting("vanmanagementsection", "delivery_per_custom_slot"); } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings