DzSoft
3T
- Регистрация
- 13 Сен 2007
- Сообщения
- 357
- Реакции
- 296
- Автор темы
- #1
Всем привет!
проблема с CodeIgniter, Zend
Решил добавить ещё один документ. везде всё прописал/добавил.
в бд шалон меняется/указывается. всё как нада.
добавляю сам шаблон вывода документа receipt_template
нажимаю на кнопку вывести документ и получаю 404
где подкосячил?
схема такая
if() {} elseif() {} else {}
помогите решить вопрос где собака зарыта?
проблема с CodeIgniter, Zend
PHP:
public function invoice($id,$type)
{
$this->data['db'] = $this->reparation_model->findReparationByID($id);
$this->data['items'] = $this->reparation_model->getAllReparationItems($id);
$this->data['tax_rate'] = $this->settings_model->getTaxRateByID($this->data['db']['tax_id']);
$this->data['client'] = $this->reparation_model->getClientNameByID($this->reparation_model->id_from_name($this->data['db']['name']));
$this->data['currency'] = $this->mSettings->currency;
$this->data['language'] = $this->mSettings->language;
$this->data['status'] = $this->settings_model->getStatusByID($this->data['db']['status']);
$this->data['user'] = $this->mUser;
$this->data['two_copies'] = 0;
$this->data['is_a4'] = 0;
// $this->mSettings->invoice_template = 3;
// $this->mSettings->report_template = 1;
if($type == 1) {
$this->settings_model->addLog('view-invoice', 'reparation', $id, json_encode(array(
'repair' => $this->data['db'],
'items' => $this->data['items'],
)));
$this->mPageTitle = lang('invoice_title');
if (in_array($this->mSettings->invoice_template, array(1,2,3))) {
$this->load->view($this->theme . 'template/invoice_template'.$this->mSettings->invoice_template, $this->data);
}else{
$this->load->view($this->theme . 'template/invoice_template1', $this->data);
}
} else {
$this->settings_model->addLog('view-report', 'reparation', $id, json_encode(array(
'repair' => $this->data['db'],
'items' => $this->data['items'],
)));
$this->mPageTitle = lang('report');
if (in_array($this->mSettings->report_template, array(1,2,3))) {
$this->load->view($this->theme . 'template/report_template'.$this->mSettings->report_template, $this->data);
}else{
$this->load->view($this->theme . 'template/report_template1', $this->data);
}
};
}
Решил добавить ещё один документ. везде всё прописал/добавил.
в бд шалон меняется/указывается. всё как нада.
добавляю сам шаблон вывода документа receipt_template
нажимаю на кнопку вывести документ и получаю 404
где подкосячил?
схема такая
if() {} elseif() {} else {}
PHP:
public function invoice($id,$type)
{
$this->data['db'] = $this->reparation_model->findReparationByID($id);
$this->data['items'] = $this->reparation_model->getAllReparationItems($id);
$this->data['tax_rate'] = $this->settings_model->getTaxRateByID($this->data['db']['tax_id']);
$this->data['client'] = $this->reparation_model->getClientNameByID($this->reparation_model->id_from_name($this->data['db']['name']));
$this->data['currency'] = $this->mSettings->currency;
$this->data['language'] = $this->mSettings->language;
$this->data['status'] = $this->settings_model->getStatusByID($this->data['db']['status']);
$this->data['user'] = $this->mUser;
$this->data['two_copies'] = 0;
$this->data['is_a4'] = 0;
// $this->mSettings->invoice_template = 3;
// $this->mSettings->receipt_template = 1;
// $this->mSettings->report_template = 1;
if($type == 1) {
$this->settings_model->addLog('view-invoice', 'reparation', $id, json_encode(array(
'repair' => $this->data['db'],
'items' => $this->data['items'],
)));
$this->mPageTitle = lang('invoice_title');
if (in_array($this->mSettings->invoice_template, array(1,2,3))) {
$this->load->view($this->theme . 'template/invoice_template'.$this->mSettings->invoice_template, $this->data);
}else{
$this->load->view($this->theme . 'template/invoice_template1', $this->data);
}
} elseif ($type == 2) {
$this->settings_model->addLog('view-receipt', 'reparation', $id, json_encode(array(
'repair' => $this->data['db'],
'items' => $this->data['items'],
)));
$this->mPageTitle = lang('receipt'); //квитанция
if (in_array($this->mSettings->receipt_template, array(1,2,3))) {
$this->load->view($this->theme . 'template/receipt_template'.$this->mSettings->receipt_template, $this->data);
}else{
$this->load->view($this->theme . 'template/receipt_template1', $this->data);
}
} else {
$this->settings_model->addLog('view-report', 'reparation', $id, json_encode(array(
'repair' => $this->data['db'],
'items' => $this->data['items'],
)));
$this->mPageTitle = lang('report');
if (in_array($this->mSettings->report_template, array(1,2,3))) {
$this->load->view($this->theme . 'template/report_template'.$this->mSettings->report_template, $this->data);
}else{
$this->load->view($this->theme . 'template/report_template1', $this->data);
}
};
}
Последнее редактирование: