Added the google_analytics_code in the booking page.

This commit is contained in:
Alex Tselegidis 2015-10-07 21:38:14 +02:00
parent e0c3c0eba5
commit 6bfa642339
3 changed files with 460 additions and 436 deletions

View file

@ -88,6 +88,8 @@ class Appointments extends CI_Controller {
$customer = array(); $customer = array();
} }
$google_analytics_code = $this->settings_model->get_setting('google_analytics_code');
// Load the book appointment view. // Load the book appointment view.
$view = array ( $view = array (
'available_services' => $available_services, 'available_services' => $available_services,
@ -96,7 +98,8 @@ class Appointments extends CI_Controller {
'manage_mode' => $manage_mode, 'manage_mode' => $manage_mode,
'appointment_data' => $appointment, 'appointment_data' => $appointment,
'provider_data' => $provider, 'provider_data' => $provider,
'customer_data' => $customer 'customer_data' => $customer,
'google_analytics_code' => $google_analytics_code
); );
} catch(Exception $exc) { } catch(Exception $exc) {

View file

@ -403,5 +403,17 @@
<script <script
type="text/javascript" type="text/javascript"
src="<?php echo $this->config->item('base_url'); ?>/assets/js/general_functions.js"></script> src="<?php echo $this->config->item('base_url'); ?>/assets/js/general_functions.js"></script>
<?php if ($google_analytics_code !== ''): ?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?php echo $google_analytics_code; ?>', 'auto');
ga('send', 'pageview');
</script>
<?php endif; ?>
</body> </body>
</html> </html>

View file

@ -66,36 +66,45 @@
<?php } ?> <?php } ?>
</legend> </legend>
<div class="wrapper"> <div class="wrapper row">
<div class="form-group"> <div class="col-md-6">
<label for="company-name"><?php echo $this->lang->line('company_name'); ?> *</label> <div class="form-group">
<input type="text" id="company-name" data-field="company_name" class="required form-control"> <label for="company-name"><?php echo $this->lang->line('company_name'); ?> *</label>
<span class="help-block"> <input type="text" id="company-name" data-field="company_name" class="required form-control">
<?php echo $this->lang->line('company_name_hint'); ?> <span class="help-block">
</span> <?php echo $this->lang->line('company_name_hint'); ?>
</span>
</div>
<div class="form-group">
<label for="company-email"><?php echo $this->lang->line('company_email'); ?> *</label>
<input type="text" id="company-email" data-field="company_email" class="required form-control">
<span class="help-block">
<?php echo $this->lang->line('company_email_hint'); ?>
</span>
</div>
<div class="form-group">
<label for="company-link"><?php echo $this->lang->line('company_link'); ?> *</label>
<input type="text" id="company-link" data-field="company_link" class="required form-control">
<span class="help-block">
<?php echo $this->lang->line('company_link_hint'); ?>
</span>
</div>
<a href="<?php echo $this->config->item('base_url'); ?>" target="_blank" class="btn btn-info">
<span class="glyphicon glyphicon-calendar"></span>
<?php echo $this->lang->line('go_to_booking_page'); ?>
</a>
</div> </div>
<div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="company-email"><?php echo $this->lang->line('company_email'); ?> *</label> <label for="google-analytics-code">
<input type="text" id="company-email" data-field="company_email" class="required form-control"> Google Analytics ID</label>
<span class="help-block"> <input type="text" id="google-analytics-code" placeholder="UA-XXXXXXXX-X"
<?php echo $this->lang->line('company_email_hint'); ?> data-field="google_analytics_code" class="form-control">
</span> </div>
</div> </div>
<div class="form-group">
<label for="company-link"><?php echo $this->lang->line('company_link'); ?> *</label>
<input type="text" id="company-link" data-field="company_link" class="required form-control">
<span class="help-block">
<?php echo $this->lang->line('company_link_hint'); ?>
</span>
</div>
<a href="<?php echo $this->config->item('base_url'); ?>" target="_blank" class="btn btn-info">
<span class="glyphicon glyphicon-calendar"></span>
<?php echo $this->lang->line('go_to_booking_page'); ?>
</a>
</div> </div>
</fieldset> </fieldset>
</form> </form>