How to Print Route in Opencart 3

In controller php file like header.php

$data['route']="";
		if (!isset($this->request->get['route'])) {
			$data['route']="home";//$this->request->get['route'];
		}else		if (isset($this->request->get['route']) && $this->request->get['route']=="common/home") {
			$data['route']="home";
		}else{
			$data['route']=$this->request->get['route'];
		}
		
		return $this->load->view('common/header', $data);

In view twig file like header.twig

 {{ route }}

godaddy ftp not working with jio fiber

Try to connect using these steps.

1.go to your ftp accounts on cpanel.

2.click on configure ftp clients.

3.note down the server ip address of the hosting account for Ex;(127.0.0.1).

4.open filezilla and goto site manager .

5.in host field write down the ip address of the hosting server and port 21.

6.In encryption tab only use plain ftp insecure.

7.In logon method select Ask for password.

8.enter the username & password shown in configure ftp clients.

9.its done it connects automatically.

Email : adityaypi@yahoo.com, Mobile : +91-9555699081

how to login aws using password instead of key file

how to connect filezilla to aws ec2 using password

allow ec2 ubuntu server login using password instead of pem file

To enable a password authentication, you create a password, update the /etc/ssh/sshd_config file, and then restart the SSH service. The following procedure is tested on Amazon Linux, RHEL, SUSE, and Ubuntu.

Note: Using a password-based login rather than key pair authentication has security implications. Therefore, password-based login isn’t recommended. Also, it’s a best practice to minimize the source IP addresses of the security group rules associated with your instance to prevent an SSH attack.

Resolution

1.    From an SSH client, log in to your EC2 instance.

Use one of the following user names:

  • For Amazon Linux, the user name is ec2-user.
  • For RHEL 5, the user name is either root or ec2-user.
  • For Ubuntu, the user name is ubuntu.
  • For SUSE Linux, the user name is either root or ec2-user.

If ec2-user or root doesn’t work, check with your AMI provider.

2.    Set a password for user. The example below uses ec2-user as the user:

$ sudo passwd ec2-user
Changing password for user ec2-user.
New password:
Retype new password:

For example, a successful response looks like this:

passwd: all authentication tokens updated successfully.

3.    Update the PasswordAuthentication parameter in the /etc/ssh/sshd_config file:

PasswordAuthentication yes

4.    Restart the SSH service.

For Amazon Linux, RHEL 5, and SUSE Linux, use this command:

sudo service sshd restart

For Ubuntu, use this command:

sudo service ssh restart

5.    Exit the SSH client, and then log in to test the password authentication.

How to Create BMI Calculator in Opencart 3.x

Step1: Create language file (catalog\language\en-gb\information\bmi_calculator.php)

<?php
// Heading
$_['heading_title']  = 'BMI Calculator';

Step2: Create controller file (catalog\controller\information\bmi_calculator.php)

<?php
class ControllerInformationBmiCalculator extends Controller {
	private $error = array();
private $bmi;
private $bmi_result;
	public function index() {
		$this->load->language('information/bmi_calculator');

		$this->document->setTitle($this->language->get('heading_title'));
		$data['btn_bmi'] ='';
		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			
			if (isset($this->request->post['btn_bmi'])) {
				$data['btn_bmi'] = $this->request->post['btn_bmi'];
			} 
		$height_feet=	$this->request->post['height_feet'];
		$height_inches=	$this->request->post['height_inches'];
		//$cm=($height_feet * 30.48)+($height_inches * 2.54);
		$m=($height_feet * 0.3048 )+($height_inches * 0.0254 );
		$weight_kg=	$this->request->post['weight_kg'];
		$gender=	$this->request->post['gender'];
		$age=	$this->request->post['age'];
		$activity_level=	$this->request->post['activity_level'];
		$height_feet=	$this->request->post['height_feet'];
		$bmi=round($weight_kg / ($m * $m),2);
		$data['m']=$m;
		$data['bmi']=$bmi;
		if($bmi < 16.0)
		{
$bmi_result="Severely Underweight";
$texth1="Your BMI is $bmi. A BMI of bellow 16 is considered severely underweight.";
$text1="You are within the normal weight range for your height. A healthy weight for you is between 9 st 11 lbs and 13 st 3 lbs. You should consider carefully whether you need to diet.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}else if($bmi >= 16.0 && $bmi <= 18.4)
		{
$bmi_result="Underweight";
$texth1="Your BMI is $bmi. A BMI of 16 - 18.4 is considered underweight.";
$text1="Your BMI is considered underweight. Keep in mind that an underweight BMI calculation may pose certain health risks. Please consult with your healthcare provider for more information about BMI calculations.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";

		} else if($bmi >= 18.5 && $bmi <= 24.9)
		{
$bmi_result="Normal";
$texth1="Your BMI is $bmi. A BMI of 18.5 - 24.9 is considered normal.";
$text1="Your BMI is considered normal. This healthy weight helps reduce your risk of serious health conditions and means you’re close to your fitness goals.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}else if($bmi >= 25.0 && $bmi <= 29.9)
		{
$bmi_result="Overweight";
$texth1="Your BMI is $bmi. A BMI of 25 - 29.9 is considered overweight.";
$text1="Your BMI is considered overweight. Being overweight may increase your risk of cardiovascular disease. Consult with your healthcare provider and consider making lifestyle changes through healthy eating and fitness to improve your health.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}else if($bmi >= 30.0 && $bmi <= 34.9)
		{
$bmi_result="Moderately Obese";
$texth1="Your BMI is $bmi. A BMI of 30 - 34.9 is considered moderately obese.";
$text1="Your BMI is considered obese. People with obesity are at increased risk for many diseases and health conditions, including cardiovascular disease, high blood pressure (Hypertension), Type 2 diabetes, breathing problems and more. Consult with your healthcare provider and consider making lifestyle changes through healthy eating and fitness to improve your overall health and quality of life.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}else if($bmi >= 35.0 && $bmi <= 39.9)
		{
$bmi_result="Severely Obese";
$texth1="Your BMI is $bmi. A BMI of 35 - 39.9 is considered severely obese.";
$text1="Your BMI is considered underweight. Keep in mind that an underweight BMI calculation may pose certain health risks. Please consult with your healthcare provider for more information about BMI calculations.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}else if($bmi >= 40.0)
		{
$bmi_result="Morbidly Obese";
$texth1="Your BMI is $bmi. A BMI of above 40.0 is considered morbidly obese.";
$text1="Your BMI is considered underweight. Keep in mind that an underweight BMI calculation may pose certain health risks. Please consult with your healthcare provider for more information about BMI calculations.";
$texth2="Daily calorie requirements";
$text2="Based on your height, weight, age and level of exercise we estimate that you will burn 2182 calories (kcal) per day. For a healthy weight loss of 1-2lbs per week you should eat around 1482 calories per day.";
$texth3="Following the Insta Diet plan";
$text3="Once you add your daily milk, fresh fruit, vegetables and carbohydrates to your Insta Diet meals and snacks, you’ll be consuming around 1,200 calories per day. Based on your BMI you should add an extra 282 calories per day to reach your target calorie intake to ensure a steady and sustainable weight loss.";
$text4="If you're looking to lose weight or maintain your healthy BMI, our lower calorie meal plans can help.";
		}
		$data['m']=$m;
		$data['bmi']=$bmi;
		$data['bmi_result']=$bmi_result;
		$data['texth1']=$texth1;
		$data['text1']=$text1;
		$data['texth2']=$texth2;
		$data['text2']=$text2;
		$data['texth3']=$texth3;
		$data['text3']=$text3;
		$data['text4']=$text4;
		}

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/home')
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('information/bmi_calculator')
		);

		if (isset($this->error['activity'])) {
			$data['error_activity'] = $this->error['activity'];
		} else {
			$data['error_activity'] = '';
		}

		if (isset($this->error['height_weight'])) {
			$data['error_height_weight'] = $this->error['height_weight'];
		} else {
			$data['error_height_weight'] = '';
		}
		
		if (isset($this->error['gender'])) {
			$data['error_gender'] = $this->error['gender'];
		} else {
			$data['error_gender'] = '';
		}
		if (isset($this->error['age'])) {
			$data['error_age'] = $this->error['age'];
		} else {
			$data['error_age'] = '';
		}
		if (isset($this->error['email'])) {
			$data['error_email'] = $this->error['email'];
		} else {
			$data['error_email'] = '';
		}

		if (isset($this->error['enquiry'])) {
			$data['error_enquiry'] = $this->error['enquiry'];
		} else {
			$data['error_enquiry'] = '';
		}

		$data['button_submit'] = $this->language->get('button_submit');

		$data['action'] = $this->url->link('information/bmi_calculator', '', true);

		$this->load->model('tool/image');

		if ($this->config->get('config_image')) {
			$data['image'] = $this->model_tool_image->resize($this->config->get('config_image'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_location_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_location_height'));
		} else {
			$data['image'] = false;
		}

		$data['store'] = $this->config->get('config_name');
		$data['address'] = nl2br($this->config->get('config_address'));
		$data['geocode'] = $this->config->get('config_geocode');
		$data['geocode_hl'] = $this->config->get('config_language');
		$data['telephone'] = $this->config->get('config_telephone');
		$data['fax'] = $this->config->get('config_fax');
		$data['open'] = nl2br($this->config->get('config_open'));
		$data['comment'] = $this->config->get('config_comment');

		$data['locations'] = array();

		$this->load->model('localisation/location');

		foreach((array)$this->config->get('config_location') as $location_id) {
			$location_info = $this->model_localisation_location->getLocation($location_id);

			if ($location_info) {
				if ($location_info['image']) {
					$image = $this->model_tool_image->resize($location_info['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_location_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_location_height'));
				} else {
					$image = false;
				}

				$data['locations'][] = array(
					'location_id' => $location_info['location_id'],
					'name'        => $location_info['name'],
					'address'     => nl2br($location_info['address']),
					'geocode'     => $location_info['geocode'],
					'telephone'   => $location_info['telephone'],
					'fax'         => $location_info['fax'],
					'image'       => $image,
					'open'        => nl2br($location_info['open']),
					'comment'     => $location_info['comment']
				);
			}
		}

		if (isset($this->request->post['height_feet'])) {
			$data['height_feet'] = $this->request->post['height_feet'];
		} else {
			$data['height_feet'] = '';
		}
		if (isset($this->request->post['height_inches'])) {
			$data['height_inches'] = $this->request->post['height_inches'];
		} else {
			$data['height_inches'] = '';
		}
		if (isset($this->request->post['weight_stone'])) {
			$data['weight_stone'] = $this->request->post['weight_stone'];
		} else {
			$data['weight_stone'] = '';
		}
		if (isset($this->request->post['weight_pounds'])) {
			$data['weight_pounds'] = $this->request->post['weight_pounds'];
		} else {
			$data['weight_pounds'] = '';
		}
		if (isset($this->request->post['weight_kg'])) {
			$data['weight_kg'] = $this->request->post['weight_kg'];
		} else {
			$data['weight_kg'] = '';
		}
		if (isset($this->request->post['age'])) {
			$data['age'] = $this->request->post['age'];
		} else {
			$data['age'] = '';
		}
		if (isset($this->request->post['gender'])) {
			$data['gender'] = $this->request->post['gender'];
		} else {
			$data['gender'] = '';
		}

		if (isset($this->request->post['activity_level'])) {
			$data['activity_level'] = $this->request->post['activity_level'];
		} else {
			$data['activity_level'] = '';
		}
		

		if (isset($this->request->post['email'])) {
			$data['email'] = $this->request->post['email'];
		} else {
			$data['email'] = '';
		}

		if (isset($this->request->post['enquiry'])) {
			$data['enquiry'] = $this->request->post['enquiry'];
		} else {
			$data['enquiry'] = '';
		}

		// Captcha
		if ($this->config->get('captcha_' . $this->config->get('config_captcha') . '_status') && in_array('contact', (array)$this->config->get('config_captcha_page'))) {
			$data['captcha'] = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha'), $this->error);
		} else {
			$data['captcha'] = '';
		}

		$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

		$this->response->setOutput($this->load->view('information/bmi_calculator', $data));
	}

	protected function validate() {
		if ((trim(utf8_strlen($this->request->post['weight_kg'])) < 1) ) {
			$this->error['height_weight'] = $this->language->get('error_name');
		}
		/*if ((trim(utf8_strlen($this->request->post['weight_pounds'])) < 1) ) {
			$this->error['height_weight'] = $this->language->get('error_name');
		}
		if ((trim(utf8_strlen($this->request->post['weight_stone'])) < 1) ) {
			$this->error['height_weight'] = $this->language->get('error_name');
		}*/
		if ((trim(utf8_strlen($this->request->post['height_inches'])) < 1) ) {
			$this->error['height_weight'] = $this->language->get('error_name');
		}
		if ((trim(utf8_strlen($this->request->post['height_feet'])) < 1) ) {
			$this->error['height_weight'] = $this->language->get('error_name');
		}
		if ((trim(utf8_strlen($this->request->post['gender'])) < 1) ) {
			$this->error['gender'] = $this->language->get('error_name');
			
		}
		
		if ((trim(utf8_strlen($this->request->post['age'])) < 1) ) {
			$this->error['age'] = $this->language->get('error_name');
		}
		if ((trim(utf8_strlen($this->request->post['activity_level'])) < 1) ) {
			$this->error['activity'] = $this->language->get('error_name');
		}

		if (!filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {
			$this->error['email'] = $this->language->get('error_email');
		}

		

		// Captcha
		if ($this->config->get('captcha_' . $this->config->get('config_captcha') . '_status') && in_array('contact', (array)$this->config->get('config_captcha_page'))) {
			$captcha = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha') . '/validate');

			if ($captcha) {
				$this->error['captcha'] = $captcha;
			}
		}

		return !$this->error;
	}

	public function success() {
		$this->load->language('information/bmi_calculator');

		$this->document->setTitle($this->language->get('heading_title'));

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/home')
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('information/bmi_calculator')
		);

		$data['continue'] = $this->url->link('common/home');

		$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

		$this->response->setOutput($this->load->view('common/success', $data));
	}
}

Step3: Create view file (catalog\view\theme\default\template\information\bmi_calculator.twig)

{{ header }}
<style>
.inner {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
}
  .bmi-results {
    background-color: #fff;
    position: relative;
    -webkit-box-shadow: 0px -10px 50px 0px rgba(0, 0, 0, 0.1);
    box-shadow: 0px -10px 50px 0px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    /* display: none; */
}
 .bmi-results:before {
    top: -20px;
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-right: 20px solid transparent;
    border-left: 20px solid transparent;
    border-bottom: 20px solid #fff;
    position: absolute;
    z-index: 1;
    left: 50%;
    margin-left: -20px;
    -webkit-transition: top 0.3s linear;
    transition: top 0.3s linear;
}
  .information-container {
    position: relative;
    z-index: 1;
  padding:5px 15px;
  background-color:white;
}
  .top h1 {
    padding-top: 10px;
}
  .information-container p {
    font-size: 16px;
    line-height: 1.5;
}
</style>
<div id="information-contact" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }}">{{ content_top }}
      <h1>{{ heading_title }}</h1>     
      
      <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
        <fieldset>
          <legend>{{ text_contact }}</legend>
          <div class="block calculator-container">
  <div class="bmi-calculator">
    <div class="bmi-calculator-inner">
      <div class="top panel-with-shadow">
        <div class="dial-icon-container"></div>
        <h3><strong>FREE</strong> BMI Calculator</h3>
      </div>
      <div class="form-container">
          <div class="bmi-row units-row block-container">
            <div class="input-container units block">
              <label> Height<br>
              </label>
              <div class="select-style">
                <select name="height_feet" id="id_height_feet" required="">
                  <option value="" selected="">ft</option>
                  <option value="3">3ft</option>
                  <option value="4">4ft</option>
                  <option value="5">5ft</option>
                  <option value="6">6ft</option>
                  <option value="7">7ft</option>
                </select>
              </div>
              <div class="select-style">
                <select name="height_inches" id="id_height_inches" required="">
                  <option value="" selected="">in</option>
                  <option value="0">0in</option>
                  <option value="1">1in</option>
                  <option value="2">2in</option>
                  <option value="3">3in</option>
                  <option value="4">4in</option>
                  <option value="5">5in</option>
                  <option value="6">6in</option>
                  <option value="7">7in</option>
                  <option value="8">8in</option>
                  <option value="9">9in</option>
                  <option value="10">10in</option>
                  <option value="11">11in</option>
                </select>
              </div>
            </div>
            <div class="input-container text-container units block">
              <label>Weight<br>
              </label>
            <!--  <div class="select-style">
                <select name="weight_stone" id="id_weight_stone" required="">
                  <option value="" selected="">st</option>
                  <option value="6">6st</option>
                  <option value="7">7st</option>
                  <option value="8">8st</option>
                  <option value="9">9st</option>
                  <option value="10">10st</option>
                  <option value="11">11st</option>
                  <option value="12">12st</option>
                  <option value="13">13st</option>
                  <option value="14">14st</option>
                  <option value="15">15st</option>
                  <option value="16">16st</option>
                  <option value="17">17st</option>
                  <option value="18">18st</option>
                  <option value="19">19st</option>
                  <option value="20">20st</option>
                  <option value="21">21st</option>
                  <option value="22">22st</option>
                  <option value="23">23st</option>
                  <option value="24">24st</option>
                  <option value="25">25st</option>
                  <option value="26">26st</option>
                  <option value="27">27st</option>
                  <option value="28">28st</option>
                  <option value="29">29st</option>
                  <option value="30">30st</option>
                </select>
              </div>
              <div class="select-style">
                <select name="weight_pounds" id="id_weight_pounds" required="">
                  <option value="" selected="">lbs</option>
                  <option value="0">0lbs</option>
                  <option value="1">1lbs</option>
                  <option value="2">2lbs</option>
                  <option value="3">3lbs</option>
                  <option value="4">4lbs</option>
                  <option value="5">5lbs</option>
                  <option value="6">6lbs</option>
                  <option value="7">7lbs</option>
                  <option value="8">8lbs</option>
                  <option value="9">9lbs</option>
                  <option value="10">10lbs</option>
                  <option value="11">11lbs</option>
                  <option value="12">12lbs</option>
                  <option value="13">13lbs</option>
                </select>
              </div>-->
             <input type="text" name="weight_kg" id="id_weight_kg" placeholder="Your weight in KG" size="15" required value="{{ weight_kg }}" >
            </div>
             {% if error_height_weight %}
              <div class="text-danger">{{ error_name }}</div>
              {% endif %}
          </div>
          <div class="bmi-row">
            <div class="input-container radios">
              <label class="pdl">Gender<br><br>
              </label>
              <label class="radio-style">
              <input type="radio" id="id_gender_M" value="M" name="gender">
              <span></span>
              <label for="id_gender_0">Male</label>
              </label>
              <label class="radio-style">
              <input type="radio" id="id_gender_F" value="F" name="gender" checked="">
              <span></span>
              <label for="id_gender_1">Female</label>
              </label>
            </div>
             {% if error_gender %}
              <div class="text-danger">{{ error_name }}</div>
              {% endif %}
          </div>
          <div class="bmi-row">
            <div class="input-container select-container">
              <label>Age<br>
              </label>
              <div class="select-style">
                <select name="age" id="id_age" required="">
                  <option value="" selected="">Age</option>
                  <option value="18">18</option>
                  <option value="19">19</option>
                  <option value="20">20</option>
                  <option value="21">21</option>
                  <option value="22">22</option>
                  <option value="23">23</option>
                  <option value="24">24</option>
                  <option value="25">25</option>
                  <option value="26">26</option>
                  <option value="27">27</option>
                  <option value="28">28</option>
                  <option value="29">29</option>
                  <option value="30">30</option>
                  <option value="31">31</option>
                  <option value="32">32</option>
                  <option value="33">33</option>
                  <option value="34">34</option>
                  <option value="35">35</option>
                  <option value="36">36</option>
                  <option value="37">37</option>
                  <option value="38">38</option>
                  <option value="39">39</option>
                  <option value="40">40</option>
                  <option value="41">41</option>
                  <option value="42">42</option>
                  <option value="43">43</option>
                  <option value="44">44</option>
                  <option value="45">45</option>
                  <option value="46">46</option>
                  <option value="47">47</option>
                  <option value="48">48</option>
                  <option value="49">49</option>
                  <option value="50">50</option>
                  <option value="51">51</option>
                  <option value="52">52</option>
                  <option value="53">53</option>
                  <option value="54">54</option>
                  <option value="55">55</option>
                  <option value="56">56</option>
                  <option value="57">57</option>
                  <option value="58">58</option>
                  <option value="59">59</option>
                  <option value="60">60</option>
                  <option value="61">61</option>
                  <option value="62">62</option>
                  <option value="63">63</option>
                  <option value="64">64</option>
                  <option value="65">65</option>
                  <option value="66">66</option>
                  <option value="67">67</option>
                  <option value="68">68</option>
                  <option value="69">69</option>
                  <option value="70">70</option>
                  <option value="71">71</option>
                  <option value="72">72</option>
                  <option value="73">73</option>
                  <option value="74">74</option>
                  <option value="75">75</option>
                  <option value="76">76</option>
                  <option value="77">77</option>
                  <option value="78">78</option>
                  <option value="79">79</option>
                  <option value="80">80</option>
                  <option value="81">81</option>
                  <option value="82">82</option>
                  <option value="83">83</option>
                  <option value="84">84</option>
                  <option value="85">85</option>
                  <option value="86">86</option>
                  <option value="87">87</option>
                  <option value="88">88</option>
                  <option value="89">89</option>
                  <option value="90">90</option>
                </select>
              </div>
               {% if error_age %}
              <div class="text-danger">{{ error_name }}</div>
              {% endif %}
            </div>
          </div>
          <div class="bmi-row">
            <div class="input-container select-container">
              <label>Activity Level<br>
              </label>
              <div class="select-style">
                <select name="activity_level" id="id_activity_level" required="">
                  <option value="" selected="">Activity level</option>
                  <option value="1">None or very little</option>
                  <option value="2">Light exercise 1-3 days a week</option>
                  <option value="3">Moderate exercise 3-5 days a week</option>
                  <option value="4">Hard exercise 6-7 days a week</option>
                  <option value="5">Very hard exercise and physical job</option>
                </select>                
              </div>
              {% if error_activity %}
              <div class="text-danger">{{ error_name }}</div>
              {% endif %}
            </div>
          </div>
          <div class="bmi-row">
            <div class="input-container text-container">
              <label for="id_email">Email Address<br>
              </label>
              <input type="email" name="email" id="id_email" placeholder="Your email address" size="15" required value="{{ email }}" >
              {% if error_email %}
              <div class="text-danger">{{ error_email }}</div>
              {% endif %}
              <span class="icon-i information-dropdown">
              <div class="dropdown">We'll email you a copy of your profile</div>
              </span> </div>
          </div>
         <div class="bmi-row">
            <div class="input-container radios">
              <label class="pdl">Send me diet tips &amp; offers<br><br>
              </label>
              <label class="radio-style">
              <input type="radio" id="diet_tips_0" value="1" name="diet_tips">
              <span></span>
              <label for="id_gender_0">Yes</label>
              </label>
              <label class="radio-style">
              <input type="radio" id="diet_tips_1" value="0" name="diet_tips" checked="">
              <span></span>
              <label for="id_gender_1">No</label>
              </label>
            </div>
          </div>
         
          <div class="bmi-row signup-row">
            <button class="button burgundy" type="submit" name="btn_bmi" value="{{ button_submit }}">Show my results</button>
          </div>
        
      </div>
    </div>
  </div>
</div>
          {{ captcha }}
        </fieldset>
        <!--<div class="buttons">
          <div class="pull-right">
            <input class="btn btn-primary" type="submit" value="{{ button_submit }}" />
          </div>
        </div>-->
      </form>
      <script>
          {% if height_feet %}
       $('#id_height_feet').val({{ height_feet }});
              {% endif %}
          {% if height_inches %}
       $('#id_height_inches').val({{ height_inches }});
              {% endif %}
          {% if weight_stone %}
       $('#id_weight_stone').val({{ weight_stone }});
              {% endif %}
        {% if weight_pounds %}
       $('#id_weight_pounds').val({{ weight_pounds }});
              {% endif %}
        {% if age %}
       $('#id_age').val({{ age }});
              {% endif %}
        {% if activity_level %}
       $('#id_activity_level').val({{ activity_level }});
              {% endif %}
         {% if gender %}
       $('#id_gender_{{ gender }}').prop("checked", true);
              {% endif %}
      </script>
       {% if btn_bmi %}
      <div class="inner bmi-results-container">
        <div class="bmi-results open">
          <div class="top panel-with-shadow"> <h1 class="text-center">Your BMI Result</h1></div>
          <div class="information-container">
            <h2>{{ texth1 }}</h2>
            <p>{{ text1 }}</p>
            <h2>{{ texth2 }}</h2>
            <p>{{ text2 }}</p>
            <h2>{{ texth3 }}</h2>
            <p>{{ text3 }}</p>
            <p>{{ text4 }}</p>
            
          </div>
        </div>
       
      </div>
              {% endif %}
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
{{ footer }}

How to change price according to option on product in opencart 3.x

Login into opencart admin, select theme editor from design sidebar menu. Then
1. choose your store -> Default
2. choose template -> Product
3. open file product.twig
and write this below code:

modify line number 186

and add javascript/jquery code below file

 var orgprice=$(".fprice").html().substring(1);
function CalcOption()
  {
  var symb=$(".fprice").html().substring(0,1);

   var value=0;
   $("input[type=radio]:checked").each(function() {
       value += parseFloat($(this).attr("id").substring(1).replace(",", ""));
   });
  value=parseFloat(orgprice)+parseFloat(value);
 $(".fprice").html(symb+value.toFixed(2));
  }

get all selected radio button value jquery

Example1

 var orgprice=$(".fprice").html().substring(1);
function CalcOption()
  {
  var symb=$(".fprice").html().substring(0,1);

   var value=0;
   $("input[type=radio]:checked").each(function() {
       value += parseFloat($(this).attr("id").substring(1).replace(",", ""));
   });
  value=parseFloat(orgprice)+parseFloat(value);
 $(".fprice").html(symb+value.toFixed(2));
  }

Example2

result = "success";
$("#myForm input[type=radio]:checked").each(function() {
  if(this.value == "No" && this.checked == true)
  {
     result = "fail";
     return false;
  }
});
alert(result);  

Example3

$(document).ready(function(){
   $("#myForm input[type=radio]:checked").each(function() {
       var value = $(this).val();
   });
});

Soa Technology

Good news! Amazon India announces 20,000 seasonal jobs in customer service

Amazon India on Sunday said that it has opened close to 20,000 seasonal employment opportunities in its customer service organisation. Most of the positions are part of the firm’s virtual customer service programme that provides work from home options.

The new positions are open across 11 locations including Kolkata, Pune and Hyderabad.

The announcement comes a little over a month after Amazon created nearly 50,000 temporary job opportunities in the country across its fulfilment and delivery networks.

As coronavirus cases are surging in the country, consumers are increasingly resorting to online shopping to meet their consumption needs. After e-commerce firms resumed full operations in the country, companies registered a spike in consumer search for products like electronic items, home appliances, casual wear and other work-from-home enablers.

Launch of sale events by online firms may be an indicator of significant consumer demand. Amazon recently concluded a seven-day sale.

The creation of the fresh job roles come amidst expectations of a continued rise in demand going forward.

“We estimate that customer traffic will further scale up over the next six months with the onset of Indian and global holiday seasons,” said Akshay Prabhu, director at customer service, Amazon India.

Based on the candidates’ performance as well as business needs, a percentage of the present temporary positions are likely to be converted into permanent positions towards the end of the year, the company said.

Earlier this year, Jeff Bezos-led Amazon had announced that it plans to create 1 million new jobs in India by 2025 through continued investments in technology, infrastructure and its logistics network. Amazon’s investments have enabled nearly 700,000 jobs over the past seven years in India.

DNSSEC – What Is It and Why Is It Important?

A brief description of how DNS works

To understand Domain Name System Security Extensions (DNSSEC), it helps to have a basic understanding of the Domain Name System (DNS).

The proper functioning of the Internet is critically dependent on the DNS . Every web page visited, every email sent, every picture retrieved from a social media: all those interactions use the DNS to translate human-friendly domain names (such as icann.org) to the IP addresses (such as 192.0.43.7 and 2001:500:88:200::7) needed by servers, routers, and other network devices to route traffic across the Internet to the proper destination.

Using the Internet on any device starts with the DNS. For example, consider when a user enters a web site name in a browser on their phone. The browser uses the stub resolver, which is part of the device’s operating system, to begin the process of translating the web site’s domain name into an Internet Protocol (IP) address. A stub resolver is a very simple DNS client that relays an application’s request for DNS data to a more complicated DNS client called a recursive resolver. Many network operators run recursive resolvers to handle DNS requests, or queries, sent by devices on their network. (Smaller operators and organizations sometimes use recursive resolvers on other networks, including recursive resolvers operated as a service for the public, such as Google Public DNS, OpenDNS, and Quad9.)

The recursive resolver tracks down, or resolves, the answer to the DNS query sent by the stub resolver. This resolution process requires the recursive resolver to send its own DNS queries, usually to multiple different authoritative name servers. The DNS data for every domain name is stored on an authoritative name server somewhere on the Internet. DNS data for a domain is called a zone. Some organizations operate their own name servers to publish their zones, but usually organizations outsource this function to third parties. There are different types of organizations that host DNS zones on behalf of others, including registrars, registries, web hosting companies, network server providers, just to name a few.

DNS by itself is not secure

DNS was designed in the 1980s when the Internet was much smaller, and security was not a primary consideration in its design. As a result, when a recursive resolver sends a query to an authoritative name server, the resolver has no way to verify the authenticity of the response. The resolver can only check that a response appears to come from the same IP address where the resolver sent the original query. But relying on the source IP address of a response is not a strong authentication mechanism, since the source IP address of a DNS response packet can be easily forged, or spoofed. As DNS was originally designed, a resolver cannot easily detect a forged response to one of its queries. An attacker can easily masquerade as the authoritative server that a resolver originally queried by spoofing a response that appears to come from that authoritative server. In other words an attacker can redirect a user to a potentially malicious site without the user realizing it.

Recursive resolvers cache the DNS data they receive from authoritative name servers to speed up the resolution process. If a stub resolver asks for DNS data that the recursive resolver has in its cache, the recursive resolver can answer immediately without the delay introduced by first querying one or more authoritative servers. This reliance on caching has a downside, however: if an attacker sends a forged DNS response that is accepted by a recursive resolver, the attacker has poisoned the cache of the recursive resolver. The resolver will then proceed to return the fraudulent DNS data to other devices that query for it.

As an example of the threat posed by a cache-poisoning attack, consider what happens when a user visits their bank’s website. The user’s device queries its configured recursive name server for the bank web site’s IP address. But an attacker could have poisoned the resolver with an IP address that points not to the legitimate site but to a web site created by the attacker. This fraudulent website impersonates the bank website and looks just the same. The unknowing user would enter their name and password, as usual. Unfortunately, the user has inadvertently provided its banking credentials to the attacker, who could then log in as that user at the legitimate bank web site to transfer funds or take other unauthorized actions.

The DNS Security Extensions (DNSSEC)

Engineers in the Internet Engineering Task Force (IETF), the organization responsible for the DNS protocol standards, long realized the lack of stronger authentication in DNS was a problem. Work on a solution began in the 1990s and the result was the DNSSEC Security Extensions (DNSSEC).

DNSSEC strengthens authentication in DNS using digital signatures based on public key cryptography. With DNSSEC, it’s not DNS queries and responses themselves that are cryptographically signed, but rather DNS data itself is signed by the owner of the data.

Every DNS zone has a public/private key pair. The zone owner uses the zone’s private key to sign DNS data in the zone and generate digital signatures over that data. As the name “private key” implies, this key material is kept secret by the zone owner. The zone’s public key, however, is published in the zone itself for anyone to retrieve. Any recursive resolver that looks up data in the zone also retrieves the zone’s public key, which it uses to validate the authenticity of the DNS data. The resolver confirms that the digital signature over the DNS data it retrieved is valid. If so, the DNS data is legitimate and is returned to the user. If the signature does not validate, the resolver assumes an attack, discards the data, and returns an error to the user.

DNSSEC adds two important features to the DNS protocol:

  • Data origin authentication allows a resolver to cryptographically verify that the data it received actually came from the zone where it believes the data originated.
  • Data integrity protection allows the resolver to know that the data hasn’t been modified in transit since it was originally signed by the zone owner with the zone’s private key.

Trusting DNSSEC keys

Every zone publishes its public key, which a recursive resolver retrieves to validate data in the zone. But how can a resolver ensure that a zone’s public key itself is authentic? A zone’s public key is signed, just like the other data in the zone. However, the public key is not signed by the zone’s private key, but by the parent zone’s private key. For example, the icann.org zone’s public key is signed by the org zone. Just as a DNS zone’s parent is responsible for publishing a child zone’s list of authoritative name servers, a zone’s parent is also responsible for vouching for the authenticity of its child zone’s public key. Every zone’s public key is signed by its parent zone, except for the root zone: it has no parent to sign its key.

The root zone’s public key is therefore an important starting point for validating DNS data. If a resolver trusts the root zone’s public key, it can trust the public keys of top-level zones signed by the root’s private key, such as the public key for the org zone. And because the resolver can trust the public key for the org zone, it can trust public keys that have been signed by their respective private key, such as the public key for icann.org. (In actual practice, the parent zone doesn’t sign the child zone’s key directly–the actual mechanism is more complicated–but the effect is the same as if the parent had signed the child’s key.)

The sequence of cryptographic keys signing other cryptographic keys is called a chain of trust. The public key at the beginning of a chain of trust is a called a trust anchor. A resolver has a list of trust anchors, which are public keys for different zones that the resolver trusts implicitly. Most resolvers are configured with just one trust anchor: the public key for the root zone. By trusting this key at the top of the DNS hierarchy, a resolve can build a chain of trust to any location in the DNS name space, as long as every zone in the path is signed.

Validating and Signing with DNSSEC

In order for the Internet to have widespread security, DNSSEC needs to be widely deployed. DNSSEC is not automatic: right now it needs to be specifically enabled by network operators at their recursive resolvers and also by domain name owners at their zone’s authoritative servers. The operators of resolvers and of authoritative servers have different incentives to turn on DNSSEC for their systems, but when they do, more users are assured of getting authenticated answers to their DNS queries. Quite simply, a user can have assurance that they are going to end up at their desired online destination.

Enabling DNSSEC validation in recursive resolvers is easy. In fact, it has been supported by nearly all common resolvers for many years. Turning it on involves changing just a few lines in the resolver’s configuration file. From that point forward, when a user asks the resolver for DNS information that comes from zones that are signed, and that data has been tampered with, the user will (purposely) get no data back. DNSSEC protects the user from getting bad data from a signed zone by detecting the attack and preventing the user from receiving the tampered data.

Signing zones with DNSSEC takes a few steps, but there are millions of zones that sign their DNS information so that users of validating resolvers can be assured of getting good data. Almost all common authoritative name server software supports signing zones, and many third-party DNS hosting providers also support DNSSEC. Usually, enabling DNSSEC for a zone with a hosting provider is quite easy: often it entails little more than clicking a check box.

For a zone owner to deploy DNSSEC by signing their zone’s data, that zone’s parent, and its parent, all the way to the root zone, also need to be signed for DNSSEC to be as effective as possible. A continuous chain of signed zones starting at the root zone allows a resolver to build a chain of trust from the root zone to validate data. For example, to effectively deploy DNSSEC in the icann.org zone, the org zone needs to be signed as well as the root zone. Fortunately, the DNS root zone has been signed since 2010, and all gTLDs and many ccTLDs are also signed.

There is one more step to complete DNSSEC deployment in a zone: the newly signed zone’s public key material needs to be sent to the zone’s parent. As described earlier, the parent zone signs the child zone’s public key, and allows a chain of trust to be built from parent to child.

Today the zone owner usually needs to communicate the zone’s public key material to the parent manually. In most cases, that communication happens through the zone owner’s registrar. Just as a zone owner interacts with its registrar to make other changes to a zone, such as the list of the zone’s authoritative name servers, the zone owner also interacts with the registrar to update the zone’s public key material. While this process is currently manual, recently developed protocols are expected to allow this process to be automated in the future.

The next steps for DNSSEC

As DNSSEC deployment grows, the DNS can become a foundation for other protocols that require a way to store data securely. New protocols have been developed that rely on DNSSEC and thus only work in zones that are signed. For example, DNS-based Authentication of Named Entities (DANE) allows the publication of Transport Layer Security (TLS) keys in zones for applications such as mail transport. DANE provides a way to verify the authenticity of public keys that does not rely on certificate authorities. New ways of adding privacy to DNS queries will be able to use DANE in the future, as well.

In 2018, ICANN changed the trust anchor for the DNS root for the first time. Many lessons were learned about DNSSEC during that process. Furthermore, many resolver operators became more aware of DNSSEC and turned on validation, and the world got to more clearly see how the entire DNSSEC system worked. In the coming years, ICANN hopes to see greater adoption of DNSSEC, both by resolver operators and zone owners. This would mean that more users everywhere could benefit from DNSSEC’s strong cryptographic assurance that they are getting authentic DNS answers to their queries.

How to Use Wget in Ubuntu

The wget command allows you to download files from the Internet using a Linux operating system such as Ubuntu. Use this command to download either a single Web page or a complete copy of your company’s website. It also includes an option for downloading any external links included on the site. The command recreates the complete directory structure of the site downloaded on your computer’s hard drive, and you can store the local copy as a backup or use it for testing purposes.

1

Click on the “Search” button in the Ubuntu launcher bar, type “terminal,” then double-click “Terminal” to open the application.

2

Type the following command to install the package, if it is not currently installed:

sudo apt-get install wget

Type your password when prompted.

3

Type the following command to download a single page from the website:

wget http://www.example.com/filename

Replace “www.example.com” with the name of the site you want to download, and replace “filename” with the name of the file you want to download.

4

Type the following command to download an entire website:

wget -r http://www.example.com

5

Type the following command to download the entire website and any external links:

wget -r -H http://www.example.com

How to create sitemap in WordPress without plugin

HTML sitemap designed for Users, where user can easily view all links, pages category of the site. to create HTML sitemap for your WordPress website. follow below steps.

Step 1: Open functons.php file from theme

In First step you have to do is open your currently active theme from wp-content/theme folder. In that folder you will see many php pages. like header.php, footer.php, functions.php etc. So open functions.php file in your text editior.

step 2: Download below code and paste into functions.php

You can download source code from Github and paste into functions.php add_shortcode(‘sitemap’, ‘html_sitemap’); add_shortcode() is WordPress built-in function for shortcode tag. This function requires two parameter first your shortcode and second name of your php function during execution. you can use your shortcode on page or post like [your_shortcode_name].

Step 3: Add new page from wp-admin

Now in the last step we have to do is create new page form your wp-admin panel and Give appropriate name. In this tutorial am giving page name sitemap and paste shortcode [sitemaps] and save.

Now your site is ready with Dynamic HTML Sitemap. Whenever there is new page or post published, the link of that post/page will automatically listed in sitemap.

How to create XML Sitemap

XML Sitemap generally designed for search engines to crawling and indexing our web pages and to do that first we have to create XML sitemap and we have to submit our XML sitemap to Webmaster Tool. Follow below steps to create XML sitemap.

Step 1: Open functons.php file from theme

In first step again we have to open functions.php file in your text editor from your theme folder (wp-content/themes/your_theme_folder/functions.php).

Step 2: Download below code and paste into functions.php file

Just download and copy-paste code into your functions.php file.

add_action(“publish_post”, “XML_sitemap”); add_action(“publish_page”, “XML_sitemap”);

In downloaded file, you will see above 2 lines in that file. Here, add_action() hooks or call on a specific action. This function takes two parameter, first is the name of the action and second parameter is the name of function you wish to be hook.

For e.g : In above code we pass first parameter publish_post. So whenever you will publish your new post at that time WordPress will call a custom php function XML_sitemap which we passed as second parameter to hook.

Now new page or post published on your site, this code will clear older content and write new content in existing file. Check your sitemap by www.mydomain.com/sitemap.xml, you will see updated XML sitemap of your site.

WRITTEN BY

Rohit Gilbile