diff --git a/application/views/editrequisitionform.php b/application/views/editrequisitionform.php index a727aff6..79cc86f9 100644 --- a/application/views/editrequisitionform.php +++ b/application/views/editrequisitionform.php @@ -1,4 +1,39 @@ +UOM; + $item = null; + foreach($MaterialCode as $struct) { + if ($Test == $struct->UOM) { + $item = $struct; + break; + } + } + print_r($item); + echo $item->UOM; + +if(!empty($ReqDetails)) +{ + foreach ($ReqDetails as $Req) + { + $ReqNo = $Req->ReqNo; + $ReqType = $Req->ReqType; + $Requestedby = $Req->Requestedby; + $FirstName =$Req->FirstName; + $Designation =$Req->Designation; + $DepartmentName = $Req->DepartmentName; + + } +} + +?> @@ -26,7 +61,7 @@
'RequestType','value' => set_value('ConfigValue'),'id'=>'RequestTypee', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'RequestType','value' => set_value('RequestType',$ReqType),'id'=>'RequestType', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?> @@ -38,7 +73,7 @@
'EmpID','value' => set_value('EmpID'),'id'=>'EmpID', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'EmpID','value' => set_value('EmpID',$FirstName),'id'=>'EmpID', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?> @@ -49,7 +84,7 @@
'DeptName','value' => set_value('DeptName'),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'DeptName','value' => set_value('DeptName',$DepartmentName),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -58,7 +93,7 @@
'Designation','value' => set_value('Designation'),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'Designation','value' => set_value('Designation',$Designation),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -70,10 +105,22 @@
- 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true'); - echo form_input($data); - ?> + 'Select Cost Center Name'); + //print_r( $options); + + if(!empty($CostCenter)) + { + foreach ($CostCenter as $SID): + // echo $SID->ConfigValue; + $Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ; + + endforeach; + + } + echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"'); + + ?>
@@ -116,9 +163,9 @@ $options = array("0"=>'Material Code'); //print_r( $options); - if(!empty($MaterialList)) + if(!empty($MaterialCode)) { - foreach ($MaterialList as $MID): + foreach ($MaterialCode as $MID): $options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName; @@ -251,8 +298,31 @@ - - + + + + MaterialCode ; ?> + MaterialName ; ?> + + UOM ; ?> + + Quantity ; ?> + + + +     + + + + + @@ -291,46 +361,7 @@ $(function() { //Initialize Select2 Elements $(".select2").select2(); - $('#EmpID').change(function() { - var ReqType = $('#RequestType').val(); - if(ReqType == "-1") - { - alert('Please select the Request Type'); - return false; - } - var id = $('#EmpID').val(); - - if(id != '-1') - { - $('#content').loader('show'); - - $.ajax({ - data:{id:id}, - dataType: 'json', - type:"POST", - url:"requisitionform/GetSelectedEmpDetails?ReqType="+ReqType, - success:function(json) { - $('#content').loader('hide'); - //alert(json.Cost); - $("#DeptName").val(json.emp[0]['DepartmentName']); - $("#Designation").val(json.emp[0]['Designation']); - - $("#CostCenter").empty(); - $("#CostCenter").append(json.Cost); - //$("#AvlBudgetAmount").val(json.AvlAmount); - - } - - }); - - } - else - { - alert('Please select the Employee details'); - return false; - } - -}); + $('#CostCenter').change(function() { @@ -402,11 +433,13 @@ $('#CostCenter').change(function() { }); $('#MaterialCode').change(function() { + var x = ''; + alert(x); var id = $('#MaterialCode').val(); $("#Description").val(''); $("#UOM").val(''); - if(id != '-1') + /*if(id != '-1') { $('#content').loader('show'); @@ -429,9 +462,9 @@ $("#UOM").val(''); { alert('Please select the RequestType'); return false; - } + }*/ -}); +}); }); diff --git a/application/views/requisitionform.php b/application/views/requisitionform.php index 547fc860..b7918514 100644 --- a/application/views/requisitionform.php +++ b/application/views/requisitionform.php @@ -30,7 +30,7 @@ if(!empty($Emp)) 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); - echo form_open($this->config->base_url().'addNewcost/',$attributes); ?> + echo form_open($this->config->base_url().'requisitionform/SearchRequistList',$attributes); ?>
@@ -508,7 +508,7 @@ for (step = 1; step < rowcount; step++) { function Save() { - var id = 'Draft'; + var id = '' if(validate()) { $('#content').loader('show'); @@ -524,7 +524,7 @@ function Save() $('#txtRowCount').val(''); $('#txtDeletedRow').val(''); - window.location = baseurl + 'Requisition'; + window.location = "Requisition"; } else @@ -694,7 +694,7 @@ $('.EditClick').click(function(){ }); $(".requistion").submit(function(e) { - var id= "Pending Approval"; + var id='' e.preventDefault(); if(validate()) { diff --git a/application/views/requisitionlistapproval.php b/application/views/requisitionlistapproval.php index bd98410f..21908d02 100644 --- a/application/views/requisitionlistapproval.php +++ b/application/views/requisitionlistapproval.php @@ -1,25 +1,7 @@ + -