'GET request received']; $this->response($data, 200); } public function itemModel_get($modelno) { $baseImgUrl = "https://itemimg.karatworld.net/"; $this->load->model("Items"); $this->load->model("BranchItemLedger"); // testing mode //$row = $this->Items->getItemByModelNo('DB-422'); // disabled during testing $row = $this->Items->getItemByModelNo($modelno); if($row != null) { $branches = []; $resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode); foreach($resultBranches->result() as $rowBranches ) { $branches[] = [ 'Itemcode' => $rowBranches->itemcode, 'Branch' => $rowBranches->brCode, 'QTY' => $rowBranches->endingqty ]; } $item = [ 'Itemcode' => $row->itemcode, 'Model No' => $row->modelno, 'Series' => $row->seriescode, 'Description' => $row->item_desc, 'Karat' => $row->karat, 'Size' => $row->size, 'Grams' => $row->grams, 'cts' => $row->cts, 'SRP' => number_format($row->srp, 2), //'mrp' => $row->mrp, //'MRP' => '0.00', ---------- requested to remove MRP 'pic' => $baseImgUrl.basename(str_replace('\\', '/', $row->pic)), 'Category' => $row->catCode, 'Gold ID' => $row->goldID, 'Supplier' => $row->supCode, 'modifieddate' => $row->modifieddate, 'others' => '', 'remarks' => '', 'branches' => $branches ]; $data = ['status' => 'FOUND', 'data' => $item]; } else $data = ['status' => 'NOTFOUND', 'data' => null]; $this->response($data, 200); } public function itemCode_get($itemcode) { $baseImgUrl = "https://itemimg.karatworld.net/"; $this->load->model("Items"); $this->load->model("BranchItemLedger"); //$row = $this->Items->getItemByItemcode(1093218); // disabled during testing $row = $this->Items->getItemByItemcode($itemcode); if($row != null) { $branches = []; $resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode); foreach($resultBranches->result() as $rowBranches ) { $branches[] = [ 'Itemcode' => $rowBranches->itemcode, 'Branch' => $rowBranches->brCode, 'QTY' => $rowBranches->endingqty ]; } $item = [ 'Itemcode' => $row->itemcode, 'Model No' => $row->modelno, 'Series' => $row->seriescode, 'Description' => $row->item_desc, 'Karat' => $row->karat, 'Size' => $row->size, 'Grams' => $row->grams, 'cts' => $row->cts, 'SRP' => number_format($row->srp, 2), //'mrp' => $row->mrp, //'MRP' => '0.00', ---------- requested to remove MRP 'pic' => $baseImgUrl.basename(str_replace('\\', '/', $row->pic)), 'Category' => $row->catCode, 'Gold ID' => $row->goldID, 'Supplier' => $row->supCode, 'modifieddate' => $row->modifieddate, 'others' => '', 'remarks' => '', 'branches' => $branches ]; $data = ['status' => 'FOUND', 'data' => $item]; } else $data = ['status' => 'NOTFOUND', 'data' => null]; $this->response($data, 200); } public function branchesActive_get() { $this->load->model("Branch"); $data = []; $result = $this->Branch->getbrCodeAndDescWithBranchExcempt(); foreach($result->result() as $row) $data[] = ['Branch Code' => $row->brCode, 'Discription' => $row->brCode.' ['.$row->brDesc.']']; $this->response($data, 200); } }