Exemplo n.º 1
0
 public function resetnetwork()
 {
     $template_data = array();
     $error = '';
     $this->load->library('parser');
     $this->lang->load('printerstate/resetnetwork', $this->config->item('language'));
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->load->helper('zimapi');
         if (ZimAPI_resetNetwork() == ERROR_OK) {
             // 				$error = t('wait a moment');
             // 				$this->output->set_header("Location:/connection");
             // parse the main body
             $template_data = array('hint' => t('Connect to the new printer\'s network, then press OK'), 'ok_button' => t('OK'));
             // parse all page
             $this->_parseBaseTemplate(t('ZeePro Personal Printer 21 - Reset connection'), $this->parser->parse('printerstate/resetnetwork_finish', $template_data, TRUE));
             return;
         } else {
             $error = t('Reset error');
         }
     }
     // parse the main body
     $template_data = array('reset_hint' => t('reset_hint'), 'reset_button' => t('Reset the printer\'s network'), 'error' => $error, 'back' => t('back'), 'home' => t('Home'));
     // parse all page
     $this->_parseBaseTemplate(t('ZeePro Personal Printer 21 - Reset connection'), $this->parser->parse('printerstate/resetnetwork', $template_data, TRUE));
     return;
 }
Exemplo n.º 2
0
 public function resetnetwork()
 {
     $cr = ERROR_OK;
     $this->load->helper('zimapi');
     $cr = ZimAPI_resetNetwork();
     if ($cr != ERROR_OK) {
         $this->load->helper('printerlog');
         PrinterLog_logError('reset network error by REST', __FILE__, __LINE__);
     }
     $this->_return_cr($cr);
     return;
 }