589 lines
28 KiB
PHP
Executable File
589 lines
28 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
require APPPATH . '/libraries/BaseController.php';
|
|
|
|
/**
|
|
* Class : Supplier Controller (supplier)
|
|
* User Class to control all user related operations.
|
|
* @author : Gandhimathi
|
|
* @version : 1.1
|
|
* @since : 12 Apr 2017
|
|
*/
|
|
class supplier extends BaseController
|
|
{
|
|
/**
|
|
* This is default constructor of the class
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('supplier_model');
|
|
$this->load->library('form_validation');
|
|
$this->load->library('pagination');
|
|
$this->load->library('Excel');
|
|
$this->isLoggedIn();
|
|
}
|
|
/**
|
|
* This function used to load the first screen of the user
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Supplier';
|
|
|
|
$this->loadViews("supplierListing", $this->global, NULL , NULL);
|
|
}
|
|
|
|
/**
|
|
* This function is used to load the Supplier list
|
|
*/
|
|
function supplierListing()
|
|
{
|
|
|
|
$this->load->model('supplier_model');
|
|
|
|
$data['userRecords'] = $this->supplier_model->supplierListing();
|
|
|
|
$this->global['pageTitle'] = 'Siddharth Industries : Supplier Listing';
|
|
|
|
$this->loadViews("supplierListing", $this->global, $data, NULL);
|
|
|
|
}
|
|
/**
|
|
* This function is used to load the add new supplier */
|
|
function addsupplier()
|
|
{
|
|
|
|
//$data['payment'] = $this->supplier_model->getpayment();
|
|
$data['payment'] = $this->supplier_model->getPaymentTerms();
|
|
//$data['users'] = $this->purchaseorder_model->getusers();
|
|
|
|
$this->global['pageTitle'] = 'siddharth : Add New Supplier';
|
|
|
|
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
|
|
|
}
|
|
/**
|
|
* This function is used to check whether PAN already exist or not
|
|
*/
|
|
|
|
function CheckPAN()
|
|
{
|
|
|
|
$id = $this->input->post('id');
|
|
|
|
$query = $this->supplier_model->checkPAN($id );
|
|
|
|
$query = $query[0]['PAN'];
|
|
|
|
print_r($query);
|
|
|
|
}
|
|
|
|
/* To Check the Pan Number is exists in the database or not for the selected Supplier */
|
|
function checkPanValidateSupplier() {
|
|
|
|
$SupplierID = $this->input->post('SupplierID');
|
|
$PanNo = $this->input->post('panno');
|
|
// echo 'Sup'. $SupplierID ;
|
|
$query = $this->supplier_model->checkPAN($PanNo,$SupplierID);
|
|
if (count($query)> 0)
|
|
{
|
|
$this->form_validation->set_message('checkPanValidateSupplier', 'The Entered PAN Number is already exists in the Database.');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* To Check the Pan Number is exists in the database or not */
|
|
function checkPanValidate()
|
|
{
|
|
// alert('validation pan');
|
|
|
|
$PanNo = $this->input->post('panno');
|
|
|
|
$query = $this->supplier_model->checkPAN($PanNo);
|
|
if (count($query)> 0)
|
|
{
|
|
$this->form_validation->set_message('checkPanValidate', 'The Entered PAN Number is already exists in the Database.');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function CheckGST()
|
|
{
|
|
//alert('check validation GST');
|
|
$id = $this->input->post('id');
|
|
$query = $this->supplier_model->checkGST($id);
|
|
$query = $query[0]['GSTNO'];
|
|
print_r($query);
|
|
|
|
}
|
|
|
|
|
|
/* To Check the GST Number is exists in the database or not for the selected Supplier */
|
|
function checkGstValidateSupplier() {
|
|
//alert(' gst validation GST');
|
|
$SupplierID = $this->input->post('SupplierID');
|
|
$GstNo = $this->input->post('GSTNo');
|
|
//echo 'Sup'. $SupplierID ;
|
|
$query = $this->supplier_model->checkGST($GstNo,$SupplierID);
|
|
if (count($query)> 0)
|
|
{
|
|
$this->form_validation->set_message('checkGstValidateSupplier', 'The Entered GST Number is already exists in the Database.');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
/* To Check the GST Number is exists in the database or not */
|
|
function checkGstValidate()
|
|
{
|
|
|
|
$GstNo = $this->input->post('GSTNo');
|
|
$query = $this->supplier_model->checkGST($GstNo);
|
|
if (count($query)> 0)
|
|
{
|
|
$this->form_validation->set_message('checkGstValidate', 'The Entered GST Number is already exists in the Database.');
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is used to add new Supplier to the system
|
|
*/
|
|
function addNewsupplier()
|
|
{
|
|
|
|
$pan = $this->input->post('panno');
|
|
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
|
|
$this->form_validation->set_rules('Address','Address','trim|required|');
|
|
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
|
|
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
|
|
$this->form_validation->set_rules('emailid','emailid', 'valid_email|max_length[128]|required');
|
|
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
|
|
if($pan=='')
|
|
{
|
|
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
|
|
}
|
|
else
|
|
{
|
|
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidate');
|
|
}
|
|
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidate');
|
|
|
|
if($this->form_validation->run() == FALSE)
|
|
{
|
|
$this->addsupplier();
|
|
}
|
|
else
|
|
{
|
|
$SupplierName = $this->input->post('SupplierName');
|
|
$Address = $this->input->post('Address');
|
|
$ContactNumber = $this->input->post('ContactNumber');
|
|
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
|
$EmailAddress = $this->input->post('emailid');
|
|
$Exiseregistration = $this->input->post('Exciseregistration');
|
|
$TIN = $this->input->post('TIN');
|
|
$PAN = strtoupper($this->input->post('panno'));
|
|
$GSTNo = strtoupper($this->input->post('GSTNo'));
|
|
$GSTRange = $this->input->post('GSTRange');
|
|
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
|
$UANumber = $this->input->post('UANumber');
|
|
//$PaymentTerms = $this->input->post('paymentname');
|
|
//$Payment = $this->input->post('Payment');
|
|
//$PayableAT = $this->input->post('PayableAT');
|
|
$CSTNo = $this->input->post('CSTNo');
|
|
|
|
$CSTDt = $this->input->post('dateofCST');
|
|
|
|
if($CSTDt != '' ){
|
|
if($CSTDt == '30/11/-0001'){
|
|
$CSTDate = null;
|
|
}
|
|
else{
|
|
|
|
$CSTDate = $this->dateformat($CSTDt);
|
|
//$CSTDate = $this->getDateformat($CSTDt);
|
|
}
|
|
}
|
|
else{
|
|
$CSTDate = null;
|
|
}
|
|
|
|
$EMSNo = $this->input->post('EMSNo');
|
|
$TSNo = $this->input->post('TSNo');
|
|
$IMSNo = $this->input->post('IMSNo');
|
|
$ISONo = $this->input->post('ISONo');
|
|
$OSHASNo = $this->input->post('OSHASNo');
|
|
$accno = $this->input->post('accno');
|
|
$ifsc = $this->input->post('ifsc');
|
|
$branchname = $this->input->post('branchname');
|
|
$bankaddress = $this->input->post('bankaddress');
|
|
$Createdby = $this->session->userdata ( 'userId' );
|
|
$date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
$createddate = $date->format('d-m-Y H:i:s');
|
|
$service = $this->input->post('service');
|
|
$rawmaterial =$this->input->post('rawmaterial');
|
|
$maintenance = $this->input->post('maintanance');
|
|
$PaymentId = $this->input->post('paymentid');
|
|
|
|
|
|
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'Createdby'=>$Createdby,'IsService'=>$service,'IsMaintanance'=>$maintenance,'IsRawMaterial'=>$rawmaterial); //,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment,'PayableAT'=>$PayableAT);
|
|
$result = $this->supplier_model->addNewsupplier($supplier);
|
|
|
|
|
|
if($result > 0)
|
|
{
|
|
redirect('supplierListing','refresh');
|
|
echo "<script>alert('New Supplier Created successfully!');</script>";
|
|
}
|
|
|
|
else
|
|
{
|
|
redirect('supplierListing','refresh');
|
|
echo "<script>alert('Supplier Record Not Created!');</script>";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function getDateformat($Val)
|
|
{
|
|
$date = new DateTime($Val);
|
|
$retDate = $date->format('Y-m-d H:i:s');
|
|
return $retDate;
|
|
}
|
|
|
|
//this function used to dateformat to store in db
|
|
function dateformat($DateValue)
|
|
{
|
|
$date = DateTime::createFromFormat('d/m/Y', $DateValue);//we should give the date as per DatePicker format.
|
|
|
|
//if the date picker format is mismatched means it display as invalid date so that we can use this "IF" Conditions (i.e) If the above format returns false then the date is not formatted correctly
|
|
if ($date === false) {
|
|
return false;
|
|
//return null;
|
|
}
|
|
|
|
$retDate = $date->format('Y-m-d'); //in this line using the parsed date., we can create a new formatting for storing value to datebase ("we choosing date value based on datepicker")
|
|
// echo "<script>alert($retDate);</script>";
|
|
return $retDate;
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is used to edit the Supplier information
|
|
*/
|
|
function editsupplier()
|
|
{ $pan = $this->input->post('panno');
|
|
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
|
|
$this->form_validation->set_rules('Address','Address','trim|required|');
|
|
$supplierID = $this->input->post('SupplierID');
|
|
//echo 'supID' . $supplierID ;
|
|
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
|
|
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
|
|
$this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required');
|
|
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
|
|
if($pan=='')
|
|
{
|
|
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
|
|
}
|
|
else
|
|
{
|
|
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidateSupplier');
|
|
}
|
|
|
|
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidateSupplier');
|
|
|
|
|
|
|
|
if($this->form_validation->run() == FALSE)
|
|
{
|
|
$this->viewsupplier($supplierID);
|
|
}
|
|
else
|
|
{
|
|
|
|
$SupplierName = $this->input->post('SupplierName');
|
|
$Address = $this->input->post('Address');
|
|
$ContactNumber = $this->input->post('ContactNumber');
|
|
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
|
$EmailAddress = $this->input->post('emailid');
|
|
$Exiseregistration = $this->input->post('Exciseregistration');
|
|
$TIN = $this->input->post('TIN');
|
|
$PAN = strtoupper($this->input->post('panno'));
|
|
$GSTNo = strtoupper($this->input->post('GSTNo'));
|
|
$GSTRange = $this->input->post('GSTRange');
|
|
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
|
$UANumber = $this->input->post('UANumber');
|
|
$PaymentTerms = $this->input->post('paymentname');
|
|
//print_r($PaymentTerms);
|
|
$UpdatedBy = $this->session->userdata ( 'userId' );
|
|
$chked = $this->input->post('isactive');
|
|
|
|
if( $chked != '')
|
|
{
|
|
$IsActive = '1';
|
|
}
|
|
else
|
|
{
|
|
$IsActive = '0';
|
|
}
|
|
|
|
$CSTNo = $this->input->post('CSTNo');
|
|
$CSTDt = $this->input->post('dateofCST');
|
|
|
|
if($CSTDt != '')
|
|
{$CSTDate = $this->dateformat($CSTDt);
|
|
//$CSTDate = $this->getDateformat($CSTDt);
|
|
}
|
|
else
|
|
{
|
|
$CSTDate = null;
|
|
}
|
|
|
|
$EMSNo = $this->input->post('EMSNo');
|
|
$TSNo = $this->input->post('TSNo');
|
|
$IMSNo = $this->input->post('IMSNo');
|
|
$ISONo = $this->input->post('ISONo');
|
|
$OSHASNo = $this->input->post('OSHASNo');
|
|
$accno = $this->input->post('accno');
|
|
$ifsc = $this->input->post('ifsc');
|
|
$branchname = $this->input->post('branchname');
|
|
$bankaddress = $this->input->post('bankaddress');
|
|
$service = $this->input->post('service');
|
|
$rawmaterial =$this->input->post('rawmaterial');
|
|
$maintanance = $this->input->post('maintanance');
|
|
$PaymentId = $this->input->post('paymentid');
|
|
|
|
$supplier = array();
|
|
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'UpdatedBy'=>$UpdatedBy,'IsActive'=>$IsActive,'IsService'=>$service,'IsMaintanance'=>$maintanance,'IsRawMaterial'=>$rawmaterial); //'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment);
|
|
//SupplierID, SupplierName, Address, ContactNumber, AlternateContactNumber, EmailAddress, Exiseregistration, TIN, PAN, CSTNO, CSTDate, GSTNO, GSTRange, CollectrateAddress, UANumber, PaymentTerms, PaymentDays, PayableAT, Cert_EMS, Cert_TS, Cert_IMS, Cert_ISO, Cert_OSHAS, BankAcNumber, IFSCCode, BranchName, BankAddress, Createdby, UpdatedBy, Updatedon, CreatedOn, IsActive);
|
|
|
|
$result = $this->supplier_model->UpdateSupplier($supplier, $supplierID);
|
|
|
|
|
|
if($result == True)
|
|
{
|
|
redirect('supplierListing','refresh');
|
|
echo "<script>alert('Supplier updated successfully!');</script>";
|
|
}
|
|
|
|
else
|
|
{
|
|
redirect('supplierListing','refresh');
|
|
echo "<script>alert('Supplier Record Not updated!');</script>";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function viewsupplier($SID = '')
|
|
{
|
|
$Payment = '';
|
|
if($SID == '')
|
|
{
|
|
$supplierID = $_GET['SID'];
|
|
$Payment = $_GET['Payment'];
|
|
}
|
|
else
|
|
{
|
|
|
|
$supplierID = $SID;
|
|
}
|
|
|
|
|
|
$data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID);
|
|
//$data['payment'] = $this->supplier_model->getpayment($Payment );
|
|
$data['payment'] = $this->supplier_model->getPaymentTerms($Payment);
|
|
$this->global['pageTitle'] = 'Siddharth : Edit Supplier';
|
|
|
|
$this->loadViews("editSupplier", $this->global,$data, NULL);
|
|
}
|
|
|
|
/** this function can be use for excel report **/
|
|
|
|
function export_supplierdetails(){
|
|
|
|
|
|
$this->load->library('excel');
|
|
$this->excel->setActiveSheetIndex(0)->mergeCells('J3:R3');
|
|
$this->excel->setActiveSheetIndex(0)->getStyle('J3')->getAlignment()->applyFromArray(array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,));
|
|
|
|
$this->excel->getActiveSheet()->setTitle('Supplier details');
|
|
|
|
$this->excel->getActiveSheet()->setCellValue('J3', 'SIDDHARTH INDUSTRIES Supplier Details');
|
|
|
|
$this->excel->getActiveSheet()->setCellValue('A5', 'SupplierID');
|
|
$this->excel->getActiveSheet()->setCellValue('B5', 'SupplierName');
|
|
$this->excel->getActiveSheet()->setCellValue('C5', 'Address');
|
|
$this->excel->getActiveSheet()->setCellValue('D5', 'ContactNumber');
|
|
$this->excel->getActiveSheet()->setCellValue('E5', 'AlternateContactNumber');
|
|
$this->excel->getActiveSheet()->setCellValue('F5', 'EmailAddress');
|
|
$this->excel->getActiveSheet()->setCellValue('G5', 'Exiseregistration');
|
|
$this->excel->getActiveSheet()->setCellValue('H5', 'TIN');
|
|
$this->excel->getActiveSheet()->setCellValue('I5', 'PAN');
|
|
$this->excel->getActiveSheet()->setCellValue('J5', 'CSTNO');
|
|
$this->excel->getActiveSheet()->setCellValue('K5', 'CST Date');
|
|
$this->excel->getActiveSheet()->setCellValue('L5', 'GST NO');
|
|
$this->excel->getActiveSheet()->setCellValue('M5', 'GST Range');
|
|
$this->excel->getActiveSheet()->setCellValue('N5', 'Collectrate Address');
|
|
$this->excel->getActiveSheet()->setCellValue('O5', 'UANumber');
|
|
$this->excel->getActiveSheet()->setCellValue('P5','EMS Number');
|
|
$this->excel->getActiveSheet()->setCellValue('Q5','TS Number');
|
|
$this->excel->getActiveSheet()->setCellValue('R5','IMS Number');
|
|
$this->excel->getActiveSheet()->setCellValue('S5','ISO Number');
|
|
$this->excel->getActiveSheet()->setCellValue('T5','OHSAS Number');
|
|
$this->excel->getActiveSheet()->setCellValue('U5', 'BankStatemant');
|
|
$this->excel->getActiveSheet()->setCellValue('V5', 'PaymentTerms');
|
|
$this->excel->getActiveSheet()->setCellValue('W5', 'IsService');
|
|
$this->excel->getActiveSheet()->setCellValue('X5', 'IsMaintanance');
|
|
$this->excel->getActiveSheet()->setCellValue('Y5', 'IsRawMaterial');
|
|
$this->excel->getActiveSheet()->setCellValue('Z5', 'Createdby');
|
|
$this->excel->getActiveSheet()->setCellValue('AA5', 'UpdatedBy');
|
|
$this->excel->getActiveSheet()->setCellValue('AB5', 'IsActive');
|
|
|
|
|
|
|
|
|
|
$this->excel->getActiveSheet()->getStyle('A5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('A5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('B5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('B5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('C5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('C5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('D5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('E5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('F5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('G5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('H5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('I5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('J5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('J5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('K5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('K5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('L5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('L5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('M5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('M5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('N5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('N5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('O5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('O5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('P5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('P5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('Q5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('Q5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('R5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('R5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('S5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('S5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('T5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('T5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('U5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('U5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('V5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('V5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('W5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('W5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('X5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('X5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('Y5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('Y5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('Z5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('Z5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('AA5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('AA5')->getFont()->setBold(true);
|
|
$this->excel->getActiveSheet()->getStyle('AB5')->getFont()->setSize(12);
|
|
$this->excel->getActiveSheet()->getStyle('AB5')->getFont()->setBold(true);
|
|
|
|
|
|
|
|
|
|
$exportData = $this->supplier_model->export_excel();
|
|
|
|
if ($exportData) {
|
|
$i = 6;
|
|
$s = 1;
|
|
foreach ($exportData as $data) {
|
|
|
|
$this->excel->getActiveSheet()->setCellValue('A' . $i,$data['SupplierID']);
|
|
$this->excel->getActiveSheet()->setCellValue('B' . $i,$data['SupplierName']);
|
|
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['Address']);
|
|
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['ContactNumber']);
|
|
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['AlternateContactNumber']);
|
|
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['EmailAddress']);
|
|
$this->excel->getActiveSheet()->setCellValue('G' . $i,$data['Exiseregistration']);
|
|
$this->excel->getActiveSheet()->setCellValue('H' . $i,$data['TIN']);
|
|
$this->excel->getActiveSheet()->setCellValue('I' . $i,$data['PAN']);
|
|
$this->excel->getActiveSheet()->setCellValue('J' . $i,$data['CSTNO']);
|
|
$this->excel->getActiveSheet()->setCellValue('K' . $i,$data['CSTDate']);
|
|
$this->excel->getActiveSheet()->setCellValue('L' . $i,$data['GSTNO']);
|
|
$this->excel->getActiveSheet()->setCellValue('M' . $i,$data['GSTRange']);
|
|
$this->excel->getActiveSheet()->setCellValue('N' . $i,$data['CollectrateAddress']);
|
|
$this->excel->getActiveSheet()->setCellValue('O' . $i,$data['UANumber']);
|
|
$this->excel->getActiveSheet()->setCellValue('P' . $i,$data['Cert_EMS']);
|
|
$this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['Cert_TS']);
|
|
$this->excel->getActiveSheet()->setCellValue('R' . $i,$data['Cert_IMS']);
|
|
$this->excel->getActiveSheet()->setCellValue('S' . $i,$data['Cert_ISO']);
|
|
$this->excel->getActiveSheet()->setCellValue('T' . $i,$data['Cert_OSHAS']);
|
|
$this->excel->getActiveSheet()->setCellValue('U' . $i,$data['BankAcNumber'].'-'.$data['IFSCCode'].'-'.$data['BranchName'].$data['BankAddress']);
|
|
$this->excel->getActiveSheet()->setCellValue('V' . $i,$data['PaymentTerms']);
|
|
$this->excel->getActiveSheet()->setCellValue('W' . $i,$data['IsService']);
|
|
$this->excel->getActiveSheet()->setCellValue('X' . $i,$data['IsMaintanance']);
|
|
$this->excel->getActiveSheet()->setCellValue('Y' . $i,$data['IsRawMaterial']);
|
|
$this->excel->getActiveSheet()->setCellValue('Z' . $i,$data['firstname']);
|
|
$this->excel->getActiveSheet()->setCellValue('AA' . $i,$data['Update_by']);
|
|
$this->excel->getActiveSheet()->setCellValue('AB' . $i,$data['IsActive']);
|
|
|
|
$i++;
|
|
$s++;
|
|
}
|
|
}
|
|
|
|
$filename = 'Supplierdetails' .' '. '.xls'; //save our workbook as this file name
|
|
header('Content-Type: application/vnd.ms-excel'); //mime type
|
|
header('Content-Disposition: attachment;filename="' . $filename . '"'); //tell browser what's the file name
|
|
header('Cache-Control: max-age=0'); //no cache
|
|
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
|
|
if (ob_get_contents()) ob_end_clean();
|
|
ob_start();
|
|
$objWriter->save('php://output');
|
|
|
|
|
|
}
|
|
|
|
|
|
function pageNotFound()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
|
|
|
|
$this->loadViews("404", $this->global, NULL, NULL);
|
|
}
|
|
}
|
|
|
|
?>
|