Example #1
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $usersNs - userId;
     $data = array('identifire' => $this->getIdentifire(), 'role' => $this->getRole(), 'status' => $this->getStatus());
     if (null === ($id = $this->getId())) {
         unset($data['id']);
         $data['addedon'] = time();
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updatedon'] = time();
         return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));
     }
 }
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $usersNs - userId;
     $datetime = date("Y-m-d H:i:s");
     $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())) {
         unset($data['dbcnf_id']);
         $data['created_on'] = $datetime;
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updated_on'] = $datetime;
         return $this->getMapper()->getDbTable()->update($data, array('dbcnf_id = ?' => $id));
     }
 }
Example #3
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $data = array('map_code' => $this->getMapCode(), 'map_id1' => $this->getMapId1(), 'map_id2' => $this->getMapId2(), 'status' => $this->getStatus(), 'intval1' => $this->getIntval1(), 'intval2' => $this->getIntval2(), 'strval1' => $this->getStrval1(), 'strval2' => $this->getStrval2(), 'blnval1' => $this->getBlnval1(), 'blnval2' => $this->getBlnval2(), 'dblval1' => $this->getDblval1(), 'dblval2' => $this->getDblval2());
     if (null === $this->getCreatedOn()) {
         $data['created_by'] = $usersNs->userId;
         $data['row_guid'] = Base_Uuid::guid();
         $data['created_on'] = time();
         if ($this->getMapper()->getDbTable()->insert($data)) {
             return true;
         }
     } else {
         $data['updated_by'] = $usersNs->userId;
         $data['updated_on'] = time();
         $res = $this->getMapper()->getDbTable()->update($data, array("map_code='{$this->getMapCode()}' and map_id1= '{$this->getMapId1()}' and map_id2= '{$this->getMapId2()}'"));
         if (1 == $res) {
             return true;
         } else {
             return false;
         }
     }
 }
Example #4
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $usersNs - userId;
     $datetime = date("Y-m-d H:i:s");
     $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())) {
         unset($data['message_id']);
         $data['created_on'] = $datetime;
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updated_on'] = $datetime;
         return $this->getMapper()->getDbTable()->update($data, array('message_id = ?' => $id));
     }
 }
 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('message_category_name' => $this->getMessageCategoryName());
     if (null === ($id = $this->getMessageCategoryId())) {
         unset($data['message_category_id']);
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         $data['created_on'] = time();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updated_on'] = time();
         return $this->getMapper()->getDbTable()->update($data, array('message_category_id = ?' => $id));
     }
 }
Example #7
0
 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;
         }
     }
 }
Example #8
0
 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;
         }
     }
 }
Example #9
0
 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));
     }
 }
Example #10
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $usersNs - userId;
     $datetime = date("Y-m-d H:i:s");
     $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())) {
         unset($data['config_id']);
         $data['created_on'] = $datetime;
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         if ($this->getParentConfigId() != 0) {
             return $this->getMapper()->getDbTable()->insert($data);
         } else {
             $id = $this->getMapper()->getDbTable()->insert($data);
             $data['parent_config_id'] = $id;
             return $this->getMapper()->getDbTable()->update($data, array('config_id = ?' => $id));
         }
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updated_on'] = $datetime;
         return $this->getMapper()->getDbTable()->update($data, array('config_id = ?' => $id));
     }
 }
Example #11
0
 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;
         }
     }
 }
Example #12
0
 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;
         }
     }
 }
Example #13
0
 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;
         }
     }
 }
Example #14
0
 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));
     }
 }
Example #15
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $usersNs - userId;
     $data = array('msg_id' => $this->getMsgId(), 'machine_name' => $this->getMachineName(), 'app_name' => $this->getAppName(), 'process_name' => $this->getProcessName(), 'module_name' => $this->getModuleName(), 'method_name' => $this->getMethodName(), 'log_message' => $this->getLogMessage());
     if (null === ($id = $this->getLogId())) {
         unset($data['log_id']);
         $data['created_by'] = $usersNs - userId;
         $data['row_guid'] = Base_Uuid::guid();
         $data['created_on'] = time();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updated_on'] = time();
         return $this->getMapper()->getDbTable()->update($data, array('log_id = ?' => $id));
     }
 }
Example #16
0
 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");
     $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");
     $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;
         }
     }
 }
Example #19
0
 public function save()
 {
     $usersNs = new Zend_Session_Namespace("members");
     $data = array('master_code' => $this->getMasterCode(), 'master_value' => $this->getMasterValue(), 'status' => $this->getStatus(), 'intval1' => $this->getIntval1(), 'intval2' => $this->getIntval2(), 'strval1' => $this->getStrval1(), 'strval2' => $this->getStrval2(), 'blnval1' => $this->getBlnval1(), 'blnval2' => $this->getBlnval2(), 'dblval1' => $this->getDblval1(), 'dblval2' => $this->getDblval2());
     if (null === ($master_id = $this->getMasterId())) {
         $Db = new Base_Db();
         $master_id = $Db->genSystemMasterId($this->getMasterCode());
         if (false !== $master_id) {
             $data['master_id'] = $master_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 $master_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("master_code='{$this->getMasterCode()}' and master_id = '{$master_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('user_id' => $this->getUserId(), 'menu_id' => $this->getMenuId(), 'screen_id' => $this->getScreenId(), 'action_id' => $this->getActionId());
     if (null === ($id = $this->getId())) {
         unset($data['id']);
         $data['created_by'] = $usersNs - userId;
         $guidCreate = new Base_Uuid();
         $data['row_guid'] = $guidCreate->guid();
         $data['addedon'] = time();
         return $this->getMapper()->getDbTable()->insert($data);
     } else {
         $data['updated_by'] = $usersNs - userId;
         $data['updatedon'] = time();
         return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));
     }
 }