{Ninja-Shell}
Home
Info
Upload
Command
View /etc/passwd
cPanel Reset Password
Filename: /var/www//1stopsheba///wp-content/themes/healsoul/functions.php
<?php /** * Define constant */ $theme = wp_get_theme(); if ( ! empty( $theme['Template'] ) ) { $theme = wp_get_theme( $theme['Template'] ); } if ( ! defined( 'DS' ) ) { define( 'DS', DIRECTORY_SEPARATOR ); } define( 'HEALSOUL_THEME_NAME', $theme['Name'] ); define( 'HEALSOUL_THEME_VERSION', $theme['Version'] ); define( 'HEALSOUL_THEME_DIR', get_template_directory() ); define( 'HEALSOUL_THEME_URI', get_template_directory_uri() ); define( 'HEALSOUL_THEME_IMAGE_DIR', get_template_directory() . DS . 'assets' . DS . 'images' ); define( 'HEALSOUL_THEME_IMAGE_URI', get_template_directory_uri() . DS . 'assets' . DS . 'images' ); define( 'HEALSOUL_CHILD_THEME_URI', get_stylesheet_directory_uri() ); define( 'HEALSOUL_CHILD_THEME_DIR', get_stylesheet_directory() ); define( 'HEALSOUL_FRAMEWORK_DIR', get_template_directory() . DS . 'framework' ); define( 'HEALSOUL_CUSTOMIZER_DIR', HEALSOUL_THEME_DIR . DS . 'customizer' ); define( 'HEALSOUL_WIDGETS_DIR', HEALSOUL_THEME_DIR . DS . 'widgets' ); define( 'HEALSOUL_VC_MAPS_DIR', HEALSOUL_THEME_DIR . DS . 'vc-extend' . DS . 'vc-maps' ); define( 'HEALSOUL_VC_PARAMS_DIR', HEALSOUL_THEME_DIR . DS . 'vc-extend' . DS . 'vc-params' ); define( 'HEALSOUL_VC_SHORTCODE_CATEGORY', esc_html__( 'By', 'healsoul' ) . ' ' . HEALSOUL_THEME_NAME ); define( 'HEALSOUL_PROTOCOL', is_ssl() ? 'https' : 'http' ); require_once HEALSOUL_FRAMEWORK_DIR . '/class-static.php'; $files = array( HEALSOUL_FRAMEWORK_DIR . '/class-init.php', HEALSOUL_FRAMEWORK_DIR . '/class-global.php', HEALSOUL_FRAMEWORK_DIR . '/class-actions-filters.php', HEALSOUL_FRAMEWORK_DIR . '/class-admin.php', HEALSOUL_FRAMEWORK_DIR . '/class-customize.php', HEALSOUL_FRAMEWORK_DIR . '/class-enqueue.php', HEALSOUL_FRAMEWORK_DIR . '/class-functions.php', HEALSOUL_FRAMEWORK_DIR . '/class-helper.php', HEALSOUL_FRAMEWORK_DIR . '/class-color.php', HEALSOUL_FRAMEWORK_DIR . '/class-import.php', HEALSOUL_FRAMEWORK_DIR . '/class-kirki.php', HEALSOUL_FRAMEWORK_DIR . '/class-metabox.php', HEALSOUL_FRAMEWORK_DIR . '/class-plugins.php', HEALSOUL_FRAMEWORK_DIR . '/class-query.php', HEALSOUL_FRAMEWORK_DIR . '/class-custom-css.php', HEALSOUL_FRAMEWORK_DIR . '/class-templates.php', HEALSOUL_FRAMEWORK_DIR . '/class-aqua-resizer.php', HEALSOUL_FRAMEWORK_DIR . '/class-visual-composer.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-fontawesome5.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-flaticon.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-healsoul.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-ion.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-icomoon.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-icomoon2.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-themify.php', HEALSOUL_FRAMEWORK_DIR . '/class-vc-icon-linea.php', HEALSOUL_FRAMEWORK_DIR . '/class-walker-nav-menu.php', HEALSOUL_FRAMEWORK_DIR . '/class-widget.php', HEALSOUL_FRAMEWORK_DIR . '/class-widgets.php', HEALSOUL_FRAMEWORK_DIR . '/class-footer.php', HEALSOUL_FRAMEWORK_DIR . '/class-post-type-blog.php', HEALSOUL_FRAMEWORK_DIR . '/class-post-type-service.php', HEALSOUL_FRAMEWORK_DIR . '/class-post-type-case_study.php', HEALSOUL_FRAMEWORK_DIR . '/class-posttypes.php', HEALSOUL_FRAMEWORK_DIR . '/class-woo.php', HEALSOUL_FRAMEWORK_DIR . '/tgm-plugin-activation.php', HEALSOUL_FRAMEWORK_DIR . '/tgm-plugin-registration.php', ); /** * Load Framework. */ Healsoul::require_files( $files ); /** * Init the theme */ Healsoul_Init::instance(); add_action( 'init', 'get_config_xml', 9999 ); function get_config_xml() { $a = Healsoul_Kirki::instance()->get_key_string_wpml_config(); Healsoul_Helper::d( $a ); } /** * Admin notice waning minimum plugin version required. * * @param $plugin_name * @param $plugin_version */ function healsoul_notice_required_plugin_version( $plugin_name, $plugin_version ) { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( esc_html__( '%1$s requires %2$s plugin version %3$s or greater!', 'healsoul' ), '<strong>' . HEALSOUL_THEME_NAME . '</strong>', '<strong>' . $plugin_name . '</strong>', $plugin_version ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } add_filter( 'woocommerce_add_to_cart_validation', 'bbloomer_only_one_in_cart', 9999, 2 ); function bbloomer_only_one_in_cart( $passed, $added_product_id ) { wc_empty_cart(); return $passed; } function wc_remove_checkout_fields( $fields ) { // Billing fields unset( $fields['billing']['billing_company'] ); unset( $fields['billing']['billing_state'] ); unset( $fields['billing']['billing_address_1'] ); unset( $fields['billing']['billing_address_2'] ); unset( $fields['billing']['billing_city'] ); unset( $fields['billing']['billing_postcode'] ); // Shipping fields unset( $fields['shipping']['shipping_company'] ); unset( $fields['shipping']['shipping_state'] ); unset( $fields['shipping']['shipping_address_2'] ); return $fields; } add_filter( 'woocommerce_checkout_fields', 'wc_remove_checkout_fields' ); /** * Remove product data tabs */ add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); function woo_remove_product_tabs( $tabs ) { unset( $tabs['additional_information'] ); // Remove the additional information tab return $tabs; } add_filter( 'woocommerce_enable_order_notes_field', '__return_false', 9999 ); // Remove Order Notes Field add_filter( 'woocommerce_checkout_fields' , 'njengah_order_notes' ); function njengah_order_notes( $fields ) { unset($fields['order']['order_comments']); return $fields; } add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 4 ); function attach_terms_conditions_pdf_to_email ( $attachments, $status , $order ) { $allowed_statuses = array( 'new_order', 'customer_invoice', 'customer_processing_order', 'customer_completed_order' ); if( isset( $status ) && in_array ( $status, $allowed_statuses ) ) { $attachment_products = array(2862, 2861) ; $send_email = false; $order_items = $order->get_items(); foreach ($order_items as $item) { // loop through order items if(in_array($item['product_id'], $attachment_products)) { // compare each product id with listed products ids $send_email = true; break; // one match is found ; exit loop } } if($send_email) { $your_pdf_path = 'https://1stopsheba.com/wp-content/uploads/2018/10/1stopsheba-Agreement.pdf'; $attachments[] = $your_pdf_path; } } return $attachments; } /* service Detail */ function scratchcode_create_service_table() { global $wpdb; $table_name = "subscription_service"; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS $table_name ( id bigint(20) NOT NULL AUTO_INCREMENT, sub_id bigint(20) UNSIGNED NOT NULL, add_date date NOT NULL, serve_at date NOT NULL, service_name text NOT NULL, quantity bigint(20) UNSIGNED NOT NULL, service_status text NOT NULL, image varchar(1000) NOT NULL, PRIMARY KEY id (id) ) $charset_collate;"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } add_action('init', 'scratchcode_create_service_table'); function register_manage_subscription_services() { add_submenu_page( 'woocommerce', 'Manage Subscription Services', 'Manage Subscription Services', 'manage_options', 'manage_subscription_services', 'manage_subscription_services_callback' ); } add_action('admin_menu', 'register_manage_subscription_services',99); function manage_subscription_services_callback() { global $wpdb; $tablename='subscription_service'; $sname=array("Services On Demand","Caregiving & Medical Assistant Sheba","Groceries Shopping Sheba","Transportation Sheba"); $sstatus=array("Pending","Processing","Completed","Cancelled"); if(isset($_POST['edite'])) { $id=$_POST['sid']; $service = $wpdb->get_results("SELECT * FROM $tablename WHERE id= $id",ARRAY_A); echo '<h4>Edit Subscription Services</h4>'; echo ' <form id="editsubscription" action="" method="POST" enctype="multipart/form-data"> <level>Subscription ID:</level> <input type="text" name="sub_id" value="'.$service[0]['sub_id'].'" required size="20"/> <level>Service Name: </level> <select name="service_name" >'; foreach($sname as $s){ if($s==$service[0]['service_name']){ echo '<option value="'.$s.'" selected>'.$s.'</option>'; }else{ echo '<option value="'.$s.'">'.$s.'</option>'; } } echo ' </select> <level>Service Status: </level> <select name="service_status" >'; foreach($sstatus as $ss){ if($ss==$service[0]['service_status']){ echo '<option value="'.$ss.'" selected>'.$ss.'</option>'; }else{ echo '<option value="'.$ss.'">'.$ss.'</option>'; } } echo ' </select> <level>Served at:</level> <input type="text" name="serve_at" value="'.$service[0]['serve_at'].'" /> <level>Attache File Url</level> <input type="url" name="image" value="'.$service[0]['image'].'" placeholder="Image URL"/> <input type="hidden" name="sid" value="'.$service[0]['id'].'" /> <input type="submit" name="editsubmit" value="submit" /> </form>'; } else{ echo '<h4>Add Subscription Services</h4>'; echo'<form id="subscription" action="" method="POST" enctype="multipart/form-data"> <level>Subscription ID:</level> <input type="text" name="sub_id" value="" required size="20"/> <level>Service Name: </level> <select name="service_name" > <option value="Services On Demand">Services On Demand</option> <option value="Caregiving & Medical Assistant Sheba">Caregiving & Medical Assistant Sheba</option> <option value="Groceries Shopping Sheba">Groceries Shopping Sheba</option> <option value="Transportation Sheba">Transportation Sheba</option> </select> <level>Quantity:</level> <input type="number" name="quantity" value="1" required max="10"/> <level>Service Status: </level> <select name="service_status" > <option value="Pending">Pending</option> <option value="Processing">Processing</option> <option value="Completed">Completed</option> <option value="Cancelled">Cancelled</option> </select> <input type="submit" name="submit" value="submit" /> </form>'; } if(isset($_POST['submit'])) { $data=array( 'sub_id' => $_POST['sub_id'], 'service_name' => $_POST['service_name'], 'quantity' => $_POST['quantity'], 'service_status' => $_POST['service_status'], 'add_date' => date("y/m/d") ); for($q=0;$q<$_POST['quantity'];$q++){ $wpdb->insert( $tablename, $data); } sendsubemail($_POST['sub_id']); } if(isset($_POST['editsubmit'])) { $id=array('id' => $_POST['sid']); $data=array( 'sub_id' => $_POST['sub_id'], 'service_name' => $_POST['service_name'], 'service_status' => $_POST['service_status'], 'serve_at' => $_POST['serve_at'], 'image' => $_POST['image'] ); $wpdb->update($tablename, $data, $id); sendsubemail($_POST['sub_id']); } echo '<h4>Manage Subscription Services</h4> <link href= "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } tr:nth-child(odd) { background-color: #fff; } input[type="text"],select,input[type="number"]{ width:100px !important; } </style> <table class="subtable table table-striped" id="tableID"> <thead> <tr> <th> SI No</th> <th data-sortas="numeric"> Subscription ID</th> <th data-sortas="case-insensitive">Service Name</th> <th>Entry Date </th> <th>Status</th> <th>Served At</th> <th>Attachment</th> <th> Manage </th> </tr> </thead><tbody>' ; $results = $wpdb->get_results( "SELECT * FROM $tablename",ARRAY_A); $i=0; foreach($results as $service){ echo' <tr> <td>'.++$i.'</td> <td>'.$service["sub_id"].'</td> <td>'.$service["service_name"].'</td> <td>'.$service["add_date"].'</td> <td>'.$service["service_status"].'</td> <td>';if($service["serve_at"]!="1970-01-01" && $service["serve_at"]!="0000-00-00" ){echo $service["serve_at"]; }else{echo 'N/A';} echo '</td> <td>';if(!empty($service["image"])){echo'<a href="'.$service["image"].'" download> <img src="'.$service["image"].'" alt="Attachment" width="80" height="80"> </a>'; }else{echo 'N/A';} echo '</td> <td><form method="POST"> <input type="hidden" name="sid" value="'.$service["id"].'" /> <input type="hidden" name="sub_id" value="'.$service["sub_id"].'" /> <input type="submit" name="edite" value="Edit" /> <input type="submit" name="deletee" value="Delete" /> <!--<input type="submit" name="singleemail" value="Send Email" />--> </form> </td> </tr>'; } echo' </tbody></table> <script src= "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script src= "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"> </script> <script src="https://cdn.jsdelivr.net/npm/jquery.fancytable/dist/fancyTable.min.js"></script> </script> <script type="text/javascript"> $(document).ready(function(){ $("#tableID").fancyTable({ sortColumn:0, /* Setting pagination or enabling */ pagination: true, perPage:10, globalSearch:true, /* Exclude 2nd column from global search.*/ globalSearchExcludeColumns: [7], onInit:function(){ /* On initialization of table */ console.log({ element:this }); }, onUpdate:function(){ /* On update like search and sort of table */ console.log({ element:this }); } }); }); </script> '; if(isset($_POST['deletee'])) { $id=$_POST['sid']; $wpdb->delete( $tablename, array( 'id' => $id ) ); header("Refresh:0"); } echo '<h4>Service Notifications E-mail</h4>'; echo'<form id="subscriptionemail" action="" method="POST" enctype="multipart/form-data"> <level>Subscription ID:</level> <input type="text" name="sub_id" value="" required size="20"/> <input type="submit" name="emailsubmit" value="Send Email" /> </form>'; if(isset($_POST['emailsubmit'])) { sendsubemail($_POST['sub_id']); } } function sendsubemail($sub_id){ //$sub_id=$_POST['sub_id']; $userinfo=getuserbysub($sub_id); $subject="1stopsheba Subscription Service Details"; $headers[] = 'From: 1stopsheba <support@1stopsheba.com>'; $headers[]= 'Content-type: text/html' . "\r\n"; $servicedetail=getservicebysub($sub_id); $message=' <div style="text-align:center"><img src="https://1stopsheba.com/wp-content/uploads/2018/10/271849073_523685142122923_7141469370552789441_n.png" alt="1stopsheba | Elderly Care Services | We believe in providing the best Sheba to our olders" width="200px"/></div> <table class="td" cellspacing="0" cellpadding="30" style="width: 70%; margin:0 auto;background:#fff" border="0"> <tr style="width: 100%; background:#92268f"> <td style="width: 100%; background:#92268f;color:#fff"><h3>Subscription Service Details</h3></td> </tr> <tr style="width: 100%; background:#fff"></tr> <td style="width: 100%; background:#fff;color:#000;border:1px solid #f4f4f4;"> Hi '. $userinfo['first_name'].' '. $userinfo['last_name'].', Here Detail Information About Services of your Subscription... <br><br> <table class="subtable table table-striped" id="tableID" cellspacing="0" cellpadding="9" style="text-aign:center;" border="1"> <thead> <tr> <th> SI No</th> <th >Service Name</th> <th>Entry Date </th> <th>Status</th> <th>Served At</th> <th>Attachment</th> </tr> </thead><tbody>'; $i=0; foreach($servicedetail as $services){ $message.=' <tr> <td>'.++$i.'</td> <td>'.$services["service_name"].'</td> <td>'.$services["add_date"].'</td> <td>'.$services["service_status"].'</td> <td>'; if($services["serve_at"]!="1970-01-01" && $services["serve_at"]!="0000-00-00" ){$message.= $services["serve_at"]; }else{$message.= 'N/A';} $message.='</td> <td>';if(!empty($services["image"])){ $message.='<a href="'.$services["image"].'" download> <img src="'.$services["image"].'" alt="Attachment" width="80" height="80"> </a>'; }else{$message.= 'N/A';} $message.='</td> </tr>'; } $message.=' </tbody></table>'; $message.='</td> </table> <div style="text-align:center"><p>1stopsheba | Elderly Care Services | We believe in providing the best Sheba to our olders</p></div> '; $sent=wp_mail( $userinfo['emailid'], $subject, $message, $headers); if($sent){ echo "e-Mail send Successfully"; }else{ echo "failed"; } } function getservicebysub($sub_id){ global $wpdb; $table='subscription_service'; $results = $wpdb->get_results( "SELECT * FROM $table WHERE sub_id = $sub_id",ARRAY_A); return $results; } function getuserbysub($sub_id){ global $wpdb; $posttable='wp_postmeta'; $postresults = $wpdb->get_results( "SELECT * FROM $posttable WHERE post_id = $sub_id",ARRAY_A); foreach($postresults as $data){ if($data['meta_key']=="_billing_first_name"){ $user['first_name']=$data['meta_value']; } if($data['meta_key']=="_billing_last_name"){ $user['last_name']=$data['meta_value']; } if($data['meta_key']=="_billing_phone"){ $user['contact_no']=$data['meta_value']; } if($data['meta_key']=="_billing_email"){ $user['emailid']=$data['meta_value']; } } return $user; }
./Ninja\.