i have write following code in my Controller:
Code: Select all
<?php
public function insert()
{
//load the language related to this if any
//load the model
//setting up the page title of this page is any.
//manage the session data..
if (isset($this->session->data['warning'])) {
$this->data['error'] = $this->session->data['warning'];
unset($this->session->data['warning']);
} else {
$this->data['error'] = '';
}
//getting the form data..
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_extension_news->addNews($this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->redirect($this->url->link('pro_membership/pro_membership', 'token=' . $this->session->data['token'], 'SSL'));
$this->data['action'] = $this->url->link('pro_membership/pro_membership/insert', '&token=' . $this->session->data['token'], 'SSL');
$this->data['cancel'] = $this->url->link('pro_membership/pro_membership', '&token=' . $this->session->data['token'], 'SSL');
$this->data['token'] = $this->session->data['token'];
$this->form();
}
}
this is my register.tpl file:
<?php require( DIR_TEMPLATE.$this->config->get('config_template')."/template/common/config.tpl" ); ?>
<?php echo $header; ?>
<?php if( $SPAN[0] ): ?>
<aside class="col-lg-<?php echo $SPAN[0];?> col-md-<?php echo $SPAN[0];?> col-sm-12 col-xs-12">
<?php echo $column_left; ?>
</aside>
<?php endif; ?>
<section class="col-lg-<?php echo $SPAN[1];?> col-md-<?php echo $SPAN[1];?> col-sm-12 col-xs-12">
<div id="content">
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<div class="row">
<?php if ($error) { ?>
<div class="warning"><?php echo $error; ?></div>
<?php } ?>
<div class="col-sm-8 col-md-8 col-xs-8">
<h1><?php echo $heading_title; ?></h1>
<p><?php echo $description; ?></p>
</div>
<div class="col-sm-4 col-md-4 col-xs-4"></div>
</div>
<div class="row">
<div class="col-sm-4 col-md-4 col-xs-4">
<form role="form" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="name"><?php echo $first_name; ?></label>
<input type="text" name="name" class="form-control">
</div>
<div class="form-group">
<label for="name"><?php echo $email_id; ?></label>
<input type="email" name="email" class="form-control">
</div>
<div class="form-group">
<label for="name"><?php echo $telephone; ?></label>
<input type="text" name="contact" class="form-control">
</div>
<div class="form-group">
<label for="name"><?php echo $address_one ?></label>
<input type="text" name="address_1" class="form-control">
</div>
<div class="form-group">
<label for="name"><?php echo $address_two ?></label>
<input type="text" name="address_2" class="form-control">
</div>
<div class="form-group">
<label for="name"><?php echo $city; ?></label>
<input type="text" name="city" class="form-control">
</div>
</div> <!--//end of left section of the form -->
<div class="col-sm-4 col-md-4 col-xs-4">
<div class="form-group">
<label for="name"><?php echo $state; ?></label>
<input type="text" name="state" class="form-control">
</div>
<div class="form-group">
<label for="country"><?php echo $country; ?></label>
<select class="form-control" name="country_id">
<option value=""><?php echo $country_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="name"><?php echo $pin_code; ?></label>
<input type="text" name="pin" class="form-control">
</div>
<div class="form-group">
<label for="name">Choose Plan:</label>
<input type="radio" name="plan_type" value="silver"> Silver
<input type="radio" name="plan_type" value="gold"> Gold
<input type="radio" name="plan_type" value="platinum"> Platinum
</div>
<div class="form-group">
<input type="submit" name="submit" class="btn btn-danger pull-right" value="Register">
<input type="reset" name="reset" class="btn btn-danger pull-right" value="Clear" style="margin-right:10px;">
</div>
</div> <!--//end of right section of the form -->
</form> <!-- //end of form -->
<div class="col-sm-4 col-md-4 col-xs-4"></div>
</div>
</div>
</section>
<?php echo $footer; ?>
Thanks in Advanced.
Manish