public function setplmodule($plid, $datamodel) { $this->load->helper('url'); $this->load->helper('oracledb'); $id = getCurSequeens("SEQ_PPC_LINEMODULE"); $data = array("ID" => $id, "PLID" => $plid, "ModuleID" => $datamodel['mid'], "OrderNumber" => $datamodel['order'], "Level" => $datamodel['level'], "MCELLID" => $datamodel['mcellid'], "Version" => $datamodel['version']); $this->db->insert('T_PPC_LineModule', $data); return $id; }
/** * 批量增加附件 */ public function set_model_attach($mid, $filesdata) { $this->load->helper('url'); $this->load->helper('oracledb'); $extinfo = $this->input->post('extfileinfo'); for ($i = 0; $i < count($filesdata); $i++) { $id = getCurSequeens("SEQ_PPC_MODULE_ATTACHMENT"); $data = array('ID' => $id, 'ModuleID' => $mid, 'Filename' => $filesdata[$i]['file_name'], 'Filepath' => $filesdata[$i]['file_path'], 'Fileinfo' => $extinfo[$i]); $this->db->insert('T_PPC_Module_Attachment', $data); } }
public function getmoduleSeq() { $this->load->helper('oracledb'); return getCurSequeens("SEQ_PPC_MODULE"); }
public function set_cats() { $this->load->helper('url'); $this->load->helper('oracledb'); $id = getCurSequeens("SEQ_PPC_COMPCAT"); $data = array('ID' => $id, 'ISVIEW' => 1, 'MTName' => $this->input->post('catname'), 'MTInfo' => $this->input->post('catinfo')); return $this->db->insert('T_PPC_ModuleType', $data); }
/** * 新建生产线 */ public function set_productline($showxml) { $this->load->helper('url'); $this->load->helper('oracledb'); $id = getCurSequeens("SEQ_PPC_PRODUCTLINE"); $codes = $this->input->post('selectcodes'); $staid = $this->input->post('staid'); $devcode = $this->input->post('devcode'); $isload = $this->input->post('isload'); $linetype = $this->input->post('linetype'); $caption = "pl_" . $id . "_" . $staid; $alias = $this->input->post('alias'); $data = array('ID' => $id, 'Code' => $codes, 'SatCode' => $staid, 'Caption' => $caption, 'Alias' => $alias, 'DevCode' => $devcode, 'LINETYPE' => $linetype, 'ISLOAD' => $isload, 'Version' => 'a0', 'RawVer' => '-1', 'Status' => "run", 'Author' => "", 'ISVIEW' => 1); //以下是直接使用oci做clob的插入 $sid = $this->config->item('dbusrsid'); $password = $this->config->item('dbusrpassword'); $dburl = $this->config->item('dbusrurl'); $conn = oci_connect($sid, $password, $dburl, "AL32UTF8"); $sql = "INSERT INTO\n \"T_PPC_ProductLine\"\n (\n ID, \"Code\",\"SatCode\",\"Caption\",\"Alias\",\"RawVer\",\"Status\",\"DevCode\",LINETYPE,\"Author\",\"Version\",ISVIEW,ISLOAD,\n PLXML,\"ShowXml\"\n )\n VALUES\n ( " . $id . ",'" . $codes . "','" . $staid . "','" . $caption . "','" . $alias . "',-1,'run','" . $devcode . "','" . $linetype . "','','a0',1," . $isload . ",EMPTY_CLOB(), EMPTY_CLOB()\n )\n RETURNING\n PLXML,\"ShowXml\" INTO :pllob,:showlob"; // echo $sql; $stmt = oci_parse($conn, $sql); $PlLOB = oci_new_descriptor($conn, OCI_D_LOB); $showLOB = oci_new_descriptor($conn, OCI_D_LOB); oci_bind_by_name($stmt, ":pllob", $PlLOB, -1, OCI_B_CLOB); oci_bind_by_name($stmt, ":showlob", $showLOB, -1, OCI_B_CLOB); oci_execute($stmt, OCI_DEFAULT) or die("Unable to execute query\n"); if (!$PlLOB->save('') || !$showLOB->save('')) { oci_rollback($conn); } else { oci_commit($conn); } // Free resources oci_free_statement($stmt); $PlLOB->free(); $showLOB->free(); // $showxml = $this->input->post('formxml'); updateShowCLOB($id, $showxml); $cdate = updateTime($id, 'T_PPC_ProductLine', 'CreateTime'); $data['CreateTime'] = $cdate; return $data; }
/** * 程序信息入库 */ public function set_programs($file_sing = null) { $this->load->helper('url'); $this->load->helper('oracledb'); $id = getCurSequeens("SEQ_PPC_PROGRAM"); $data = array('ID' => $id, 'ISVIEW' => 1, 'Exename' => $file_sing[0]['file_name'], 'Exepath' => $file_sing[0]['file_path'], 'Runsys' => $this->input->post('runsys'), 'Exeremark' => $this->input->post('exeinfo'), 'Exetype' => $this->input->post('exetype'), 'Version' => $this->input->post('version')); $this->db->insert('T_PPC_Program', $data); updateTime($id, 'T_PPC_Program', 'CreateTime'); return $id; }