diff --git a/application/config/routes.php b/application/config/routes.php index c664c34b..e22a7f3a 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -283,6 +283,11 @@ $route['nissaninprocess'] = "inprocess/addNewNissanInprocessInspection"; //this route path productionsalary details $route['productionsalary']="monthlypay/productionsalary"; +//Customer Enquiry + + +$route['Editenquiry'] = "purchaseorder/Editenquiry"; +$route['enquirylisting'] = "purchaseorder/enquirylist"; /* End of file routes.php */ /* Location: ./application/config/routes.php */ diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index dda4256f..e7db9047 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -3196,6 +3196,105 @@ if($advance > 0) +function SaveEnquiry() +{ + + $client_id=$this->input->post('client_id'); + $date= $this->input->post('date'); + $contact_person = $this->input->post('contact_person'); + $requirement= $this->input->post('requirement'); + $feasible = $this->input->post('feasible'); + $orderno = $this->input->post('orderno'); + $reqqty =$this->input->post('reqqty'); + $supqty = $this->input->post('supqty'); + $remarks= $this->input->post('remarks'); + + $save=array('client_id'=>$client_id,'Created_Date'=>$date,'Contact_Person'=>$contact_person,'Requirement'=>$requirement,'Feasible'=>$feasible,'OrderNo'=>$orderno,'Requested_Qty'=>$reqqty,'Supplied_Qty'=>$supqty,'Remarks'=>$remarks); + + $save_result = $this->purchaseorder_model->SaveEnquiry($save); + + if($save_result>0) + { + //echo ""; + echo "Saved Successfully"; + //redirect('purchaseorder/addenquiry','refresh'); + + } + +} + + +function UpdateEnquiry() +{ + + $client_id=$this->input->post('client_id'); + $date= $this->input->post('date'); + $contact_person = $this->input->post('contact_person'); + $requirement= $this->input->post('requirement'); + $feasible = $this->input->post('feasible'); + $orderno = $this->input->post('orderno'); + $reqqty =$this->input->post('reqqty'); + $supqty = $this->input->post('supqty'); + $remarks= $this->input->post('remarks'); + $Id = $this->input->post('id'); + + $save=array('client_id'=>$client_id,'Created_Date'=>$date,'Contact_Person'=>$contact_person,'Requirement'=>$requirement,'Feasible'=>$feasible,'OrderNo'=>$orderno,'Requested_Qty'=>$reqqty,'Supplied_Qty'=>$supqty,'Remarks'=>$remarks); + + //print_r($save); + + $save_result = $this->purchaseorder_model->UpdateEnquiry($save,$Id); + + if(($save_result ==0)||($save_result == 1)) + { + echo "Saved Successfully"; + //echo ""; + // redirect('purchaseorder/addenquiry','refresh'); + + } +} + + +public function enquiry() + { + + $data['Customer'] = $this->purchaseorder_model->GetClients(); + //$dt = date('yyyy-mm-dd'); + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + $createddt = $dt->format('Y-m-d'); + + $data['enquirycount']=$this->purchaseorder_model->GetEnquiryCount($createddt); + $this->global['pageTitle'] = 'Siddharth : Enquiry Form'; + + $this->loadViews("addenquiry", $this->global, $data , NULL); + + } + + public function Editenquiry() + { + $Id = $_GET['Id']; + //echo $Id; + $data['EnquiryDetails'] = $this->purchaseorder_model->GetEnquiry($Id); + $data['Customer'] = $this->purchaseorder_model->GetClients(); + //print_r($data['EnquiryDetails']); + + $this->global['pageTitle'] = 'Siddharth : Enquiry Form'; + + $this->loadViews("editenquiry", $this->global, $data , NULL); + + } + + public function enquirylist() + { + + $data['Customer_Order'] = $this->purchaseorder_model->GetEnquiryDetails(); + + $this->global['pageTitle'] = 'Siddharth : Enquiry List'; + + $this->loadViews("enquirylist", $this->global, $data , NULL); + + } + + } ?> diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 4c240abc..719b808b 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1768,5 +1768,72 @@ function amendpdf($PONO='') return $amendment->result(); } + + + + function GetClients() + { + $this->db->select('client_id,client_name'); + $this->db->from('ip_clients'); + $query = $this->db->get(); + return $query->result_array(); + } + + + function SaveEnquiry($save) + { + $this->db->trans_start(); + $this->db->insert('T_Enquiry', $save); + $insert_id = $this->db->affected_rows(); + $this->db->trans_complete(); + return $insert_id; + + } + + + function UpdateEnquiry($save,$Id) + { + + $this->db->where('Id',$Id); + $this->db->update('T_Enquiry',$save); + $insert_id = $this->db->affected_rows(); + return $insert_id; + } + + + function GetEnquiryDetails() + { + $this->db->select('T_Enquiry.*,client_name'); + $this->db->from('T_Enquiry'); + $this->db->join('ip_clients','ip_clients.client_id=T_Enquiry.client_id'); + $this->db->order_by('Id','desc'); + $query = $this->db->get(); + return $query->result(); + + } + + + function GetEnquiry($Id) + { + $this->db->select('T_Enquiry.*,client_name'); + $this->db->from('T_Enquiry'); + $this->db->join('ip_clients','ip_clients.client_id=T_Enquiry.client_id'); + $this->db->where('Id',$Id); + $this->db->order_by('Id','desc'); + $query = $this->db->get(); + return $query->result(); + } + + + +function GetEnquiryCount($createddt) +{ + + $this->db->select('count(Id) as Countnumber'); + $this->db->from('T_Enquiry'); + $this->db->where('Created_Date',$createddt); + $query = $this->db->get(); + return $query->result(); +} } diff --git a/application/views/addenquiry.php b/application/views/addenquiry.php new file mode 100644 index 00000000..2ac55ece --- /dev/null +++ b/application/views/addenquiry.php @@ -0,0 +1,309 @@ + +format('d-m-Y'); +$count=''; +if(!empty($enquirycount)) +{ + foreach($enquirycount as $enc) + { + $count= $enc->Countnumber; + + } +} + +$actcount=$count+1; +//echo $actcount; + +?> + + + + + + +
+ + + +
+ +
+
+
+
+

Siddharth Industries - Enquiry Form

+
+ +
+
+ + 'form-label-left advancerequest','name' => 'enquiry','id' => 'enquiry'); + + // echo form_open($this->config->base_url().'purchaseorder/addadvancerequest',$attributes); + ?> +
+
+
+ + + + 'Customer Name'); + + if(!empty($Customer)) + { //print_r($Currency); + foreach ($Customer as $Cu): + // print_r($Cu['client_id']); + + $opt[$Cu['client_id']] = $Cu['client_id'].' '.' - '.' '.$Cu['client_name']; + + endforeach; + } + + + // print_r($opt); + + echo form_dropdown('Customer', $opt,set_value('Customer'),'id="Customer"' ,'required="true"' ,'class="form-control select2'); + ?> +
+ +
+ + 'Date','value' => set_value('Date',$CurrentDate),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + echo form_input($data); + ?> +
+ + +
+ + 'Contact','value' => set_value('Contact'),'id'=>'Contact' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> + +
+ +
+ + 'requirement','value' => set_value('requirement'),'id'=>'requirement' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> +
+ + + +
+ +
+ 'Select','1'=>'YES','2'=>'NO'); + echo form_dropdown('Feasible', $optionsnew,set_value('Feasible'),'id="Feasible"' ,'required="true"' ,'class="form-control select2'); + + ?> +
+
+ + +
+ +
+ +
+ + 'Corder','value' => set_value('Corder'),'id'=>'Corder', 'class' => 'form-control num' ,'required' => 'true','style'=>'text-align:left;'); + echo form_input($data); + ?> +
+ + + +
+ +
+ + 'ReqQty','value' => set_value('ReqQty'),'id'=>'ReqQty' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> +
+
+ + + +
+ +
+ + 'SupQty','value' => set_value('SupQty'),'id'=>'SupQty' ,'class' => 'form-control' ,'style'=>'text-align:left;'); + echo form_input($data); + ?> +
+
+ + +
+ +
+ + + +
+ 'Remark','value' => set_value('Remark'),'id'=>'Remark', 'class' => 'form-control' ,'rows' => '10', 'cols' => '100','maxlength' => '500'); + echo Form_textarea($data); + ?> +
+
+
+ +
+
+   Save +
+
+ + +
+
+
+
+
+
+
+ +> diff --git a/application/views/editenquiry.php b/application/views/editenquiry.php new file mode 100644 index 00000000..27352385 --- /dev/null +++ b/application/views/editenquiry.php @@ -0,0 +1,313 @@ + +format('d-m-Y'); +$customer=''; +$date=''; +$contact_person=''; +$requirement=''; +$feasible=''; +$corderno=''; +$requestedqty=''; +$suppliedqty=''; +$remark=''; + + +if(!empty($EnquiryDetails)) +{ + foreach($EnquiryDetails as $enq) + { + $Id=$enq->Id; + $customerId=$enq->client_id; + $customer=$enq->client_name; + $date=$enq->Created_Date; + $contact_person=$enq->Contact_Person; + $requirement=$enq->Requirement; + $feasible=$enq->Feasible; + $corderno=$enq->OrderNo; + $requestedqty=$enq->Requested_Qty; + $suppliedqty=$enq->Supplied_Qty; + $remark=$enq->Remarks; + } +} +//echo $Id; + + +?> + + + + + + +
+ + +
+ +
+
+
+
+

Siddharth Industries - Enquiry Form

+
+ +
+ + +
+ 'form-label-left advancerequest','name' => 'enquiry','id' => 'enquiry'); + + // echo form_open($this->config->base_url().'purchaseorder/addadvancerequest',$attributes); + ?> +
+
+
+ + + + + + + + + + + +
+ + + +
+ + 'Date','value' => set_value('Date',$CurrentDate),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); + echo form_input($data); + ?> +
+ + +
+ + 'Contact','value' => set_value('Contact',$contact_person),'id'=>'Contact' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> + +
+ +
+ + 'requirement','value' => set_value('requirement',$requirement),'id'=>'requirement' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> +
+ + + +
+ +
+ 'YES','1'=>'NO'); + } + + else if($feasible == 'NO') + { + $optionsnew=array('0'=>'NO','1'=>'YES'); + } + + + echo form_dropdown('Feasible', $optionsnew,set_value('Feasible'),'id="Feasible"' ,'required="true"' ,'class="form-control select2'); + + ?> +
+
+ + +
+ +
+ +
+ + 'Corder','value' => set_value('Corder',$corderno),'id'=>'Corder', 'class' => 'form-control num' ,'required' => 'true','style'=>'text-align:left;'); + echo form_input($data); + ?> +
+ + + + + +
+ +
+ + 'ReqQty','value' => set_value('ReqQty',$requestedqty),'id'=>'ReqQty' ,'class' => 'form-control num' ,'required' => 'true'); + echo form_input($data); + ?> +
+
+ + + +
+ +
+ + 'SupQty','value' => set_value('SupQty',$suppliedqty),'id'=>'SupQty' ,'class' => 'form-control' ,'style'=>'text-align:left;'); + echo form_input($data); + ?> +
+
+ + +
+ +
+ + + +
+ 'Remark','value' => set_value('Remark',$remark),'id'=>'Remark', 'class' => 'form-control' ,'rows' => '10', 'cols' => '100','maxlength' => '500'); + echo Form_textarea($data); + ?> +
+
+
+ +
+
+   Save +
+
+ +
+
+ +
+
+
+
+ +> diff --git a/application/views/enquirylist.php b/application/views/enquirylist.php new file mode 100644 index 00000000..0589503d --- /dev/null +++ b/application/views/enquirylist.php @@ -0,0 +1,105 @@ + + +
+ + + +
+
+
+
+
+

Siddharth Industries - Enquiry List

+
+ +
+ + + + + + + + + + + + + + + + + + Supplied_Qty; + + if($supplied =='') + { + $Suppliedquantity=0; + // echo $Suppliedquantity; + } + else + { + $Suppliedquantity=$supplied; + //echo $Suppliedquantity; + } + + ?> + + + + + + + + + + + + + + + + + +
#DateCustomer NameContact PersonRequirementCustomer Order NoRequested QtyDelivered QtyBalance QtyFeasibilityRemarksAction
Created_Date;?>client_name;?>Contact_Person;?>Requirement;?>OrderNo;?>Requested_Qty;?>Requested_Qty)-($record->Supplied_Qty);?>Feasible;?>Remarks;?>   
+
+ +
+ + +
+ +
+ +
+ +
+ + \ No newline at end of file diff --git a/application/views/includes/header.php b/application/views/includes/header.php index 0ab9f7fe..ab77c4f1 100755 --- a/application/views/includes/header.php +++ b/application/views/includes/header.php @@ -178,6 +178,30 @@ $(function() { else{echo "non empty";}?> --> +
  • + Enquiry and Order + +
  • + + + + +