예제 #1
0
 public function __construct()
 {
     $config = parse_ini_file(__DOCROOT__ . '/config.ini', true);
     PackingList::$database_connect = mysql_connect($config['database']['host'], $config['database']['user'], $config['database']['password']);
     if (!PackingList::$database_connect) {
         echo "Unable to connect to DB: " . mysql_error(PackingList::$database_connect);
         exit;
     }
     mysql_query("SET NAMES 'UTF8'", PackingList::$database_connect);
     if (!mysql_select_db($config['database']['name'], PackingList::$database_connect)) {
         echo "Unable to select mydbname: " . mysql_error(PackingList::$database_connect);
         exit;
     }
 }
예제 #2
0
 function deleteDBSubmission()
 {
     $result = Input::get('delete');
     if ($result != 'Y-E-S') {
         $data['response'] = '<span style="color:red">DB reset has failed. Y-E-S was not entered.</span>';
         return View::make('deleteKohlsDBForm', $data);
     } else {
         PackingList::truncate();
         if (Input::get('deleteLocal') != null) {
             $this->rrmdir(storage_path() . '/Kohlspos');
             $this->rrmdir(public_path() . '/Kohlspos');
         }
         $data['response'] = '<span style="color:red">All items in the Kohls DB have been cleared.</span>';
         return View::make('deleteKohlsDBForm', $data);
     }
 }