Beispiel #1
0
 function index()
 {
     //echo site_url('blog/specific')."/".url_title($blog_title,'dash',true)."/".$blog[$i]['blog_id']
     //site_url('newsletter/specific') . "/" . url_title($newsletter[$i]['newsletter_name'], 'dash', true) . "/" . $newsletter[$i]['newsletter_id']
     //echo "hi"; die;
     /*$blogs = $this->blog_model->get_blog('', '', '', '', '','Active',array(),array());
     		$mynl_where_field = array("newsletter_relation");
             $mynl_where_value = array("parent");
     		$newsletter = $this->newsletter_model->get_newsletter('', '', '', '', '', 'Active',$mynl_where_field,$mynl_where_value);
             $data['blog'] = $blogs;
     		$data['newsletter'] = $newsletter;
     		$data['main_content'] = 'sitemap_view';
     		header("Content-Type: text/xml;charset=iso-8859-1");
     		//echo '<pre>'; print_r($data);
     		//die;
     		$filename = FCPATH . 'sitemap.xml';
     		$xml = $this->load->view('sitemap_view', $data, TRUE);
     		$this->load->helper('download');
     		//force_download($filename, $xml);
     		
     		$this->load->helper('file');
     		write_file($filename, utf8_encode($xml));*/
     echo $return = sitemap_generator();
     //write_file($save, $backup);
     //writing to file
     //$this->load->view('sitemap_view', $data);
     //$this->load->view("sitemap_view",$data);
 }
 public function databsebackup()
 {
     $prefs = array('format' => 'zip', 'filename' => 'backup-on-' . date("Y-m-d-H-i-s") . '.sql');
     $backup =& $this->dbutil->backup($prefs);
     $db_name = 'backup-on-' . date("Y-m-d-H-i-s") . '.zip';
     $save = './uploads/database/' . $db_name;
     $this->load->helper('file');
     write_file($save, $backup);
     $this->load->helper('download');
     $this->load->helper('email');
     //load email library
     $config = array('protocol' => 'smtp', 'smtp_host' => 'ssl://secure146.inmotionhosting.com', 'smtp_port' => 465, 'smtp_user' => '*****@*****.**', 'smtp_pass' => 'G#-(6Z{!d)LJ', 'mailtype' => 'html', 'charset' => 'iso-8859-1');
     $this->load->library('email', $config);
     $this->email->set_newline("\r\n");
     if (valid_email('*****@*****.**')) {
         // compose email
         $get_admin_detail = get_admin_detail();
         //common helper function for admin detail
         $this->email->from("*****@*****.**", $get_admin_detail['name']);
         $this->email->to('*****@*****.**');
         //$this->email->to('*****@*****.**');
         //			$this->email->cc('*****@*****.**');
         $this->email->set_mailtype("html");
         $this->email->subject("knewdog database backup file " . date("Y-m-d"));
         $this->email->message("<p>Please Find the attached database backup file.</p><p>Regards,<br/>knewdog Team.</p>");
         $filename = FCPATH . "uploads/database/" . $db_name;
         $this->email->attach($filename);
         if ($this->email->send()) {
             //echo 'Your email was sent, successfully.';
         } else {
             //show_error($this->email->print_debugger());
         }
         @unlink($filename);
     }
     //force_download($db_name, $backup);
     //Update sitemap everyday
     sitemap_generator();
 }