Subversion Repositories SmartDukaan

Rev

Rev 13253 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Statics extends MY_Controller {

public $layoutName ='';
  
  public function __construct() {
    // Call the CI_controller constructor
    parent::__construct();
    $this->layout->setlayout('layout/layout_main');
    $this->layoutName= $this->layout->getLayout();
    $this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
  }
  
  public function insuranceterms(){
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
    $data['stylesheet'] = 'recharge.css';
    $data['title'] = 'Theft Insurance - Terms and Conditions';
    $this->layout->view('statics/insuranceterms',$data);
  }

  public function invalidoffer(){
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
    $data['stylesheet'] = 'recharge.css';
    $data['title'] = 'Expired Offer';
    $this->layout->view('statics/invalidoffer',$data);
  }

  public function gosf() {
    $this->lessphp->object()->ccompile('assets/css/gosf.less','assets/css/gosf.css');
    $data['stylesheet'] = 'gosf.css';
    $data['title'] = 'GOSF 2014';
    $this->layout->view('statics/gosf',$data);
    if(isset($_POST) && !empty($_POST))  {
      $server = "192.168.190.114";
      $database = "helper";
      $db_user = "root";
      $db_pass = "shop2020";
      if(!isset($dbh)){
        try{
          $dbh = new PDO("mysql:host=$server;dbname=$database",$db_user,$db_pass,array(PDO::ATTR_PERSISTENT => true));
          $sql = "INSERT INTO campaigns VALUES('".$_POST['userEmail']."',1)";
          error_log("campaign_sql ".$sql);
          $dbh->exec($sql);
        }catch(Exception $ex){
          error_log("Couldn't connect to db");
            // echo "Internal Error, please try again later!";
        }
      }      
    }
  }
}

/* End of file statics.php */
/* Location: ./application/widgets/controllers/statics.php */