public function ajaxGetSaveRawProductAction() { $this->view->layout()->disableLayout(); //$this->_helper->viewRenderer->setNoRender(true); $num_cows = $this->_getParam('num_cows'); $arrIds = array(); for ($i = 0; $i < $num_cows; $i++) { $Db = new Base_Db(); $arrIds[] = $Db->genId("raw_product", 'id'); } if (count($arrIds) == 0) { $this->_helper->viewRenderer->setNoRender(true); echo "0"; } else { $this->view->arrIds = $arrIds; } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('workflow_id' => $this->getWorkflowId(), 'group_id' => $this->getGroupId(), 'subgroup_id' => $this->getSubgroupId(), 'role_id' => $this->getRoleId(), 'process_id' => $this->getProcessId(), 'preceeding_process_id' => $this->getPreceedingProcessId(), 'start_status' => $this->getStartStatus(), 'end_status' => $this->getEndStatus(), 'is_deleted' => $this->getIsDeleted()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("workflow_detail", "id"); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion(); $res = $this->getMapper()->getDbTable()->update($data, array("id='{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('name' => $this->getName(), 'value' => $this->getValue(), 'status' => $this->getStatus()); $id = $this->getId(); if ($id === null) { $Db = new Base_Db(); $id = $Db->genId("control_type", 'id'); if (false !== $id) { $data['id'] = $id; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('workflow_name' => $this->getWorkflowName(), 'is_deleted' => $this->getIsDeleted()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("workflow_master", "id"); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion(); $res = $this->getMapper()->getDbTable()->update($data, array("id='{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $usersNs - userId; $data = array('dbcnf_id' => $this->getDbcnfId(), 'config_id' => $this->getConfigId(), 'db_server_name' => $this->getDbServerName(), 'db_server_port' => $this->getDbServerPort(), 'db_name' => $this->getDbName(), 'db_user' => $this->getDbUser(), 'db_password' => $this->getDbPassword(), 'db_trans_type' => $this->getDbTransType(), 'status' => $this->getStatus()); if (null === ($id = $this->getDbcnfId())) { $Db = new Base_Db(); $id = $Db->genId("dbconfiguration", 'dbcnf_id'); if (false !== $id) { $data['dbcnf_id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("dbcnf_id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('title' => $this->getTitle(), 'description' => $this->getDescription(), 'weight' => $this->getWeight(), 'status' => $this->getStatus()); $id = $this->getId(); //echo "id==".$id; if ($id === null) { $Db = new Base_Db(); $id = $Db->genId("location", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $usersNs - userId; $data = array('parent_config_id' => $this->getParentConfigId(), 'config_name' => $this->getConfigName(), 'config_desc' => $this->getConfigDesc(), 'param1' => $this->getParam1(), 'param2' => $this->getParam2(), 'param3' => $this->getParam3(), 'param4' => $this->getParam4(), 'param5' => $this->getParam5()); if (null === ($id = $this->getConfigId())) { $Db = new Base_Db(); $id = $Db->genId("sys_config", 'config_id'); if ($id !== false) { $data['config_id'] = $id; $data['created_on'] = time(); $data['created_by'] = $usersNs - userId; $data['row_guid'] = Base_Uuid::guid(); $data['row_version'] = 0; if ($this->getParentConfigId() == 0) { $data['parent_config_id'] = $id; } if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } } else { $data['updated_by'] = $usersNs - userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; return $this->getMapper()->getDbTable()->update($data, array('config_id = ?' => $id)); } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('code_name' => $this->getCodeName(), 'code_value' => $this->getCodeValue(), 'status' => $this->getStatus()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("code_table", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { echo 'aaahere'; die; return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('org_name' => $this->getOrgName(), 'first_name' => $this->getFirstName(), 'last_name' => $this->getLastName(), 'address' => $this->getAddress(), 'city' => $this->getCity(), 'state' => $this->getState(), 'zip' => $this->getZip(), 'bfirst_name' => $this->getBFirstName(), 'blast_name' => $this->getBLastName(), 'baddress' => $this->getBAddress(), 'bcity' => $this->getBCity(), 'bstate' => $this->getBState(), 'bzip' => $this->getBZip(), 'phone' => $this->getPhone(), 'fax' => $this->getFax(), 'email' => $this->getEmail(), 'status' => $this->getStatus()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("customer", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('case_format' => $this->getCaseFormat(), 'label_case' => $this->getLabelCase(), 'product_identifier' => $this->getProductIdentifier(), 'pack_location' => $this->getPackLocation(), 'part_number' => $this->getPartNumber(), 'sell_by_days' => $this->getSellByDays(), 'price_lb' => $this->getPriceLb(), 'pallet_id' => $this->getPalletId(), 'des_line_1' => $this->getDesLine1(), 'des_line_2' => $this->getDesLine2(), 'des_line_3' => $this->getDesLine3(), 'des_line_4' => $this->getDesLine4(), 'lower_weight' => $this->getLowerWeight(), 'fixed_weight' => $this->getFixedWeight(), 'heigh_weight' => $this->getHeighWeight(), 'tare_weight' => $this->getTareWeight(), 'required_application' => $this->getRequiredApp(), 'status' => $this->getStatus()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("product", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('email' => $this->getEmail(), 'username' => $this->getUsername(), 'password' => $this->getPassword(), 'first_name' => $this->getFirstName(), 'middle_name' => $this->getMiddleName(), 'last_name' => $this->getLastName(), 'dob' => $this->getDob(), 'sex' => $this->getSex(), 'profile_picture' => $this->getProfilePicture(), 'mobile' => $this->getMobile(), 'status' => $this->getStatus(), 'correspondence_address' => $this->getCorrespondenceAddress(), 'organization_name' => $this->getOrganizationName(), 'address1' => $this->getAddress1(), 'address2' => $this->getAddress2(), 'city' => $this->getCity(), 'state' => $this->getState(), 'zip' => $this->getZip(), 'phone' => $this->getPhone(), 'fax' => $this->getFax(), 'supervisor_id' => $this->getSupervisorId(), 'group_id' => $this->getGroupId(), 'sub_group_id' => $this->getSubGroupId(), 'role_id' => $this->getRoleId()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("user", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $usersNs - userId; $data = array('category_id' => $this->getCategoryId(), 'severity_id' => $this->getSeverityId(), 'type_id' => $this->getTypeId(), 'user_message' => $this->getUserMessage(), 'sys_message' => $this->getSysMessage()); if (null === ($id = $this->getMessageId())) { $Db = new Base_Db(); $id = $Db->genId("sys_message", 'message_id'); if ($id !== false) { $data['message_id'] = $id; $data['created_on'] = time(); $data['created_by'] = $usersNs - userId; $data['row_guid'] = Base_Uuid::guid(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } } else { $data['updated_by'] = $usersNs - userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; return $this->getMapper()->getDbTable()->update($data, array('message_id = ?' => $id)); } }
public function save() { $usersNs = new Zend_Session_Namespace("members"); $data = array('sequence_no' => $this->getSequenceNo(), 'type' => $this->getType(), 'breed' => $this->getBreed(), 'color' => $this->getColor(), 'supplier_id' => $this->getSupplierId(), 'description' => $this->getDescription(), 'tag_no' => $this->getTagNo(), 'transaction_id' => $this->getTransactionId(), 'incoming_date' => $this->getIncomingDate(), 'knocked_date' => $this->getKnockedDate(), 'weighing_date' => $this->getWeighingDate(), 'auction_tag' => $this->getAuctionTag(), 'ear_tag' => $this->getEarTag(), 'trich' => $this->getTrich(), 'back_tag' => $this->getBackTag(), 'defects' => $this->getDefects(), 'grade' => $this->getGrade(), 'weight' => $this->getWeight(), 'condumn_sub_status' => $this->getCondumnSubStatus(), 'status_on' => $this->getStatusOn(), 'status' => $this->getStatus(), 'process_status' => $this->getProcessStatus()); if (null === ($id = $this->getId())) { $Db = new Base_Db(); $id = $Db->genId("raw_product", 'id'); if (false !== $id) { $data['id'] = $id; $data['created_by'] = $usersNs->userId; $data['row_guid'] = Base_Uuid::guid(); $data['created_on'] = time(); $data['row_version'] = 0; if ($this->getMapper()->getDbTable()->insert($data)) { return $id; } } else { echo 'aaahere'; die; return false; } } else { $data['updated_by'] = $usersNs->userId; $data['updated_on'] = time(); $data['row_version'] = $this->getRowVersion() + 1; $res = $this->getMapper()->getDbTable()->update($data, array("id = '{$id}' and row_version = '{$this->getRowVersion()}'")); if (1 == $res) { return true; } else { return false; } } }