示例#1
0
 public function view_saved_orders()
 {
     $this->load->helper('directory');
     //Get our account main directory
     $customer_dir = remove_punctuation($this->data['data']->company_name);
     //Path to saved files.
     $path = './uploads/' . $customer_dir . '/orders/files/';
     //Get the map of files...
     $map = directory_map($path);
     $files = array();
     foreach ($map as $file) {
         $f = new SplFileInfo($file);
         if ($f->getExtension() != 'html') {
             $files[$f->getBasename('.txt')] = unserialize(file_get_contents($path . $file));
         }
     }
     $this->data['files'] = $files;
     $this->load->view($this->modules . 'saved_orders', $this->data);
 }
示例#2
0
 public function index()
 {
     /*
      * Does this user have a directory created?
      * 
      * Create the folder name
      * 
      */
     $customer_dir = remove_punctuation($this->data['data']->company_name);
     /*
      * Does that folder exist?
      * 
      */
     if ($this->uploader->folder_exists($customer_dir) == false) {
         /*
          * Nope, so we need to create one!
          * 
          */
         $this->uploader->create_dir($customer_dir);
     }
     /*
      * We need to give the date to the schedual slug to load
      * 
      * schedule section from todays date...
      * 
      */
     $this->data['schedual_slug'] = date('Y') . '/' . date('m');
     if (!$this->session->userdata('first_login')) {
         $this->data['welcome_message'] = 'Welcome To Dashboard';
     } else {
         $this->data['welcome_message'] = 'Dashboard';
     }
     $this->session->set_userdata('first_login', true);
     /*
      * Load the template...
      * 
      */
     $this->view($this->master);
 }
示例#3
0
function normalize_name($input)
{
    $output = remove_punctuation($input);
    $output = strtolower($output);
    return $output;
}
示例#4
0
 /**
  * 
  *@param array 
  *
  * Automatically create the path from an array
  * 
  * of paremeters
  * 
  */
 public function create_path($array)
 {
     if (is_array($array)) {
         $path = '';
         foreach ($array as $a) {
             $path .= remove_punctuation($a) . '/';
         }
         return substr($path, 0, -1);
     }
     return false;
 }