Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="col-lg-6">
- <?php
- // $getNameValue is the session value passed
- $getNameValue = $this->session->userdata('nameValue');
- echo '<h3>' . $getNameValue['name'] . '</h3>';
- $getValue = $this->session->userdata('sessiondata');
- if ($getValue != NULL) {
- echo '<table class="table table-bordered table-striped">';
- echo '<tr>';
- echo '<td><strong>Product Name</strong></td>';
- echo '<td><strong>Unit</strong></td>';
- echo '<td><strong>Cost</strong></td>';
- echo "<form method='post' action=''>";
- foreach ($getValue as $row) {
- echo '<tr>';
- echo '<td><input type="hidden" name="allProduct[product_name][]" value="' . $row['product_name'] . '">' . $row['product_name'] . '</td>';
- echo '<td><input type="hidden" name="allProduct[unit][]" value="' . $row['unit'] . '">' . $row['unit'] . '</td>';
- echo '<td><input type="hidden" name="allProduct[cost][]" value="' . $row['cost'] . '">' . $row['cost'] . '</td>';
- echo '</tr>';
- }
- echo '<tr><td></td><td><td><button type="submit" class="btn btn-success">POST</button></td></td></tr>';
- echo "</form>";
- echo '</table>';
- }
- ?>
- </div>
- public function newSystemBatch($getBatch)
- {
- if ($data = $this->input->post('systemProduct')) {
- $data['batch_id'] = $getBatch;
- $productName = $data['product_name'];
- $unit = $data['unit'];
- $cost = $data['cost'];
- $getValue = $this->session->userdata('sessiondata');
- $getValue[] = array(
- 'product_name' => $productName,
- 'unit' => $unit,
- 'cost' => $cost
- );
- $this->session->set_userdata('sessiondata', $getValue);
- redirect('inventory/newSystemMessage/' . $getBatch['batch_id']);
- }
- if ($data = $this->input->post('allProduct')) {
- $this->header();
- $this->footer();
- $this->transaction->addNew($data);
- $this->load->view("admin/newSystemTable", $data);
- }
- else {
- $this->header();
- $data['action'] = 'System';
- $data['users_id'] = $this->user->users_id;
- $this->load->view("admin/newSystemTable", $data);
- $this->footer();
- }
- }
- function addNew($data)
- {
- $this->db->insert_batch('try',$data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement