suseendhiran
This commit is contained in:
parent
40222a4c19
commit
bc4eb9be01
@ -198,6 +198,8 @@ class Admin extends CI_Controller {
|
||||
$resi->refrole = ucfirst($resi->u_role);
|
||||
if($resi->u_role == 'corporate')
|
||||
$resi->refrole = $resi->c_name;
|
||||
else if($resi->u_role == 'tmc')
|
||||
$resi->refrole = $resi->c_name."/".$resi->refrole;
|
||||
$fary['data'][] = $resi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -938,18 +938,25 @@ class Corporate extends CI_Controller {
|
||||
}
|
||||
else if($col == 6){
|
||||
if($cc != ''){
|
||||
// print_r($cc);
|
||||
// $cc = date('d/M/Y', strtotime($cc));
|
||||
// print_r($cc);
|
||||
if(is_numeric($cc)){
|
||||
|
||||
$unix_date = ($cc - 25569) * 86400;
|
||||
$excel_date = 25569 + ($unix_date / 86400);
|
||||
$unix_date = ($excel_date - 25569) * 86400;
|
||||
$fdate = gmdate("Y-m-d", $unix_date);
|
||||
$values .= '"'.$fdate.'",';
|
||||
// print_r($values);die();
|
||||
}
|
||||
else{
|
||||
|
||||
$cc = str_replace('.',"-",$cc);
|
||||
$cc = str_replace('/',"-",$cc);
|
||||
$dary = explode('-',$cc);
|
||||
if($dary[0]>31 || $dary[1]>12 || $dary[2]<1900 || $dary[2]>2021){
|
||||
// print_r($dary);die();
|
||||
if($dary[0]>31 || $dary[1]>12 || $dary[2]<1900 || $dary[2]>date("Y")){
|
||||
// if(!isset($ferror['Invoice Date']))
|
||||
// $ferror['Invoice Date'] = $row.'-Invoice Date';
|
||||
$ferror[$row]['column'][] = 'Invoice Date';
|
||||
@ -970,7 +977,7 @@ class Corporate extends CI_Controller {
|
||||
}
|
||||
}
|
||||
else if($col == 7 || $col == 10 || $col == 11 || $col == 12 || $col == 13 || $col == 14 || $col == 15){
|
||||
if(!preg_match("@^[0-9]+$@",$cc)){
|
||||
if(!preg_match("@^[0-9\.]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
@ -1146,9 +1153,9 @@ class Corporate extends CI_Controller {
|
||||
public function gstr2a()
|
||||
{
|
||||
$this->checksess();
|
||||
|
||||
|
||||
$data['gstinfo'] = $this->corp->get_gstno(null,1);
|
||||
|
||||
// print_r($this->session->userdata['recon_sess_i']['u_corporateid']);die();
|
||||
$monthAllAryLabel = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
|
||||
$yearAry = array(); $monthAry = array();
|
||||
$m = date('m',time());
|
||||
@ -1162,7 +1169,6 @@ class Corporate extends CI_Controller {
|
||||
$data['month'] = $monthAry;
|
||||
$data['allmonth'] = $monthAllAryLabel;
|
||||
$data['curYear'] = date('Y',time());
|
||||
|
||||
$this->load->view('corporate/gstr2a',$data);
|
||||
}
|
||||
|
||||
@ -2810,6 +2816,7 @@ class Corporate extends CI_Controller {
|
||||
for ($row = 1; $row <= $highestRow; $row++)
|
||||
{
|
||||
if($row == 1){
|
||||
print_r("1");
|
||||
for($col = 0; $col < $pcols; $col++){
|
||||
$cell = $worksheet->getCellByColumnAndRow($col, $row);
|
||||
$cellref = $cell;
|
||||
@ -4633,7 +4640,9 @@ class Corporate extends CI_Controller {
|
||||
if($dat->f_max_date != '')
|
||||
$dat->f_max_date_ref = date('d-m-Y',strtotime($dat->f_max_date));
|
||||
$refm = $dat->f_month - 1;
|
||||
$dat->inv_ref = $monthAry[$refm]."' ".substr($dat->f_year,2,2);
|
||||
if (isset($monthAry[$refm])) {
|
||||
$dat->inv_ref = $monthAry[$refm]."' ".substr($dat->f_year,2,2);
|
||||
}
|
||||
$dat->u_name = ucfirst(strtolower($dat->u_name));
|
||||
$dat->f_uploadedat_ref = date('d-m-Y H:i',strtotime($dat->f_uploadedat));
|
||||
$fary['data'][] = $dat;
|
||||
|
||||
398
application/controllers/Tmc.php
Normal file
398
application/controllers/Tmc.php
Normal file
@ -0,0 +1,398 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Tmc extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('Tmc_model','tmc');
|
||||
//force_ssl();
|
||||
}
|
||||
|
||||
public function index(){
|
||||
redirect('tmc/tmc');
|
||||
}
|
||||
|
||||
public function checksess(){
|
||||
if(isset($this->session->userdata['recon_sess_i']['u_role'])){
|
||||
if($this->session->userdata['recon_sess_i']['u_role'] == 'admin')
|
||||
redirect('admin');
|
||||
}
|
||||
else
|
||||
redirect('login');
|
||||
}
|
||||
|
||||
public function tmc()
|
||||
{
|
||||
$this->checksess();
|
||||
$monthAllAryLabel = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
|
||||
$yearAry = array(); $monthAry = array();
|
||||
$m = date('m',time());
|
||||
for($i=0;$i<$m;$i++){
|
||||
$monthAry[] = $monthAllAryLabel[$i];
|
||||
}
|
||||
for($i=0;$i<4;$i++){
|
||||
$yearAry[] = date('Y',time()) - $i;
|
||||
}
|
||||
$data['years'] = $yearAry;
|
||||
$data['month'] = $monthAry;
|
||||
$data['allmonth'] = $monthAllAryLabel;
|
||||
$data['curYear'] = date('Y',time());
|
||||
|
||||
$this->load->view('tmc/tmc',$data);
|
||||
}
|
||||
public function tmc_recon(){
|
||||
$this->checksess();
|
||||
// $data['gstno_list'] = $this->intl->get_gstno();
|
||||
// $data['gstno_list'] = array();
|
||||
$this->load->view('tmc/tmc_recon');
|
||||
}
|
||||
|
||||
public function gen_tmc_recon(){
|
||||
$this->checksess();
|
||||
$fromdate = $this->input->post('fromdate');
|
||||
$todate = $this->input->post('todate');
|
||||
// if($gid)
|
||||
// $res = $this->db->query('select *,am_code as supplier_code from gstr2a_data gd left join (select *,group_concat(td_gst_inv) g_td_gst_inv,sum(td_net) td_net_ref from tmc_data where td_show_status = 1 group by td_tkt) td on gd.gd_id=td.td_gstr2a_match_id left join airline_master am on am.am_name=gd.gd_supplier_type where gd_id = "'.$gid.'"');
|
||||
// else
|
||||
$res = $this->db->query('select * from tmc_data td left join (select *,sum(ti_amount) s_amt from airline_invoice group by ti_tdid) ti on ti.ti_tdid = td.td_id where td_inv_date between "'.$fromdate.'" and "'.$todate.'" order by td_id desc');
|
||||
$fres['data'] = array();
|
||||
$res2 = new stdClass();
|
||||
foreach($res->result() as $res1){
|
||||
if($res1->ti_tdid == '')
|
||||
$res1->d_remarks = 'Invoice not received';
|
||||
else{
|
||||
$payremarks = ($res1->s_amt * 100) / $res1->td_tkt_fare;
|
||||
if($payremarks > 70)
|
||||
$res1->d_remarks = 'Invoice Received';
|
||||
else
|
||||
$res1->d_remarks = 'Parital Invoice Received';
|
||||
}
|
||||
$res1->tkt_like = $res1->td_tkt;
|
||||
$res1->td_inv_date = date('d-m-Y',strtotime($res1->td_inv_date));
|
||||
$fres['data'][] = $res1;
|
||||
}
|
||||
echo json_encode($fres);
|
||||
}
|
||||
|
||||
public function upload_tmc(){
|
||||
// print_r("aaaaa");
|
||||
$this->checksess();
|
||||
|
||||
$monthAllAryLabel = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
|
||||
|
||||
$insdata = $this->input->post('usr');
|
||||
$ext = pathinfo($_FILES['tmc_file']['name'], PATHINFO_EXTENSION);
|
||||
$filename = 'TMC-'.str_replace(' ','_',$insdata['f_agent']).'-'.$monthAllAryLabel[$insdata['f_month']-1].'-'.$insdata['f_year'].'-'.time().'.'.$ext;
|
||||
|
||||
$conchk['f_month'] = $insdata['f_month'];
|
||||
$conchk['f_year'] = $insdata['f_year'];
|
||||
$conchk['f_agent'] = $insdata['f_agent'];
|
||||
$conchk['f_corporateid'] = $this->session->userdata['recon_sess_i']['u_corporateid'];
|
||||
// $entryres = $this->db->get_where('files',$conchk);
|
||||
// if($entryres->num_rows()>0){
|
||||
// $rdata['status'] = 31; echo json_encode($rdata); exit;
|
||||
// }
|
||||
|
||||
if(!is_dir(dirname( dirname( dirname(__FILE__) ) ).'/uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid'])) {
|
||||
mkdir(dirname( dirname( dirname(__FILE__) ) ).'/uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid']);
|
||||
mkdir(dirname( dirname( dirname(__FILE__) ) ).'/uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid'].'/gstr2a');
|
||||
mkdir(dirname( dirname( dirname(__FILE__) ) ).'/uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid'].'/tmc');
|
||||
}
|
||||
|
||||
$config['file_name'] = $filename;
|
||||
$config['upload_path'] = './uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid'].'/tmc/';
|
||||
$config['allowed_types'] = '*';
|
||||
$config['max_size'] = 3000;
|
||||
$this->load->library('upload', $config);
|
||||
|
||||
if(!$this->upload->do_upload('tmc_file'))
|
||||
{
|
||||
$error = array('error' => $this->upload->display_errors());
|
||||
echo $error['error'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array('upload_data' => $this->upload->data());
|
||||
|
||||
$fieldAry = array("SEGMENT","INV DATE ","GST INVOICE NO","DOC TYPE","BILLING ENTITY","EMP ID","PASSENGER NAME","CARRIER NAME","TICKET NO","FLIGHTNO","SECTOR","DEPDATE &TIME","CABINCLASS","TOTAL TKT FARE","NETPAYABLE","AIR TAX DESCRIPTION","AIRLINE PNR","GDS PNR");
|
||||
|
||||
$labelAry = array('td_segment','td_inv_date','td_gst_inv','td_doc_type','td_billing_entity','td_empid','td_pax','td_carrier','td_tkt','td_flight','td_sector','td_departure','td_cabin_class','td_tkt_fare','td_net','td_air_tax','td_airline_pnr','td_pnr');
|
||||
|
||||
$inserror = 0;
|
||||
$this->load->library('excel');
|
||||
//read file from path
|
||||
$filepath = './uploads/'.$this->session->userdata['recon_sess_i']['u_corporateid'].'/tmc/'.$filename;
|
||||
$objPHPExcel = PHPExcel_IOFactory::load($filepath);
|
||||
|
||||
$worksheet = $objPHPExcel->getActiveSheet();
|
||||
$highestRow = (int)$worksheet->getHighestRow();
|
||||
$highestColumn = $worksheet->getHighestColumn();
|
||||
$seterror = 0;$ferror=array();
|
||||
$pcols = 18;$ttlrows=0;
|
||||
for ($row = 1; $row <= $highestRow; $row++)
|
||||
{
|
||||
if($row == 1){
|
||||
for($col = 0; $col < $pcols; $col++){
|
||||
$cell = $worksheet->getCellByColumnAndRow($col, $row);
|
||||
$cellref = $cell;
|
||||
$headingary[] = strval($cell);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($fieldAry != $headingary){
|
||||
// print_r($fieldAry);
|
||||
// echo '<br/>';
|
||||
// print_r($headingary);
|
||||
$rdata['status'] = 13;
|
||||
$ferror['column'] = 'Column mismatch.';
|
||||
$rdata['error'] = $ferror;
|
||||
echo json_encode($rdata); exit;
|
||||
}
|
||||
else{
|
||||
$ttlrows++;
|
||||
$chkcell = $worksheet->getCellByColumnAndRow(1, $row);
|
||||
if($chkcell != ''){
|
||||
$keys='';$values='';
|
||||
for($col = 0; $col < $pcols; $col++)
|
||||
{
|
||||
$cell = $worksheet->getCellByColumnAndRow($col, $row);
|
||||
$cell = strtoupper($cell);
|
||||
$cc = strval($cell);
|
||||
$cc = trim($cc);
|
||||
if($cell != ''){
|
||||
$keys .= $labelAry[$col].',';
|
||||
if($col == 0){
|
||||
$cc = preg_replace('/\s+/', '',trim($cc));
|
||||
if($cc != 'DOMESTIC' && $cc != 'INTERNATIONAL' && $cc != 'HOTEL' && $cc != 'MISC'){
|
||||
$seterror = 1;
|
||||
// $ferror[$row]['column'][] = 'GST INVOICE NO';
|
||||
$ferror[$row]['column'][] = 0;
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 1){
|
||||
if(is_numeric($cc)){
|
||||
$unix_date = ($cc - 25569) * 86400;
|
||||
$excel_date = 25569 + ($unix_date / 86400);
|
||||
$unix_date = ($excel_date - 25569) * 86400;
|
||||
$fdate = gmdate("Y-m-d", $unix_date);
|
||||
$values .= '"'.$fdate.'",';
|
||||
}
|
||||
else{
|
||||
$cc = str_replace('.',"-",$cc);
|
||||
$cc = str_replace('/',"-",$cc);
|
||||
$dary = explode('-',$cc);
|
||||
if($dary[0]>31 || $dary[1]>12 || $dary[2]<1900 || $dary[2]>2021){
|
||||
// if(!isset($ferror['INV DATE']))
|
||||
// $ferror['INV DATE'] = $row.'-INV DATE';
|
||||
// $ferror[$row]['column'][] = 'INV DATE';
|
||||
$ferror[$row]['column'][] = 1;
|
||||
$ferror[$row]['row'] = $row;
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else{
|
||||
$ffdate = $dary[2].'-'.$dary[1].'-'.$dary[0];
|
||||
$cc = $ffdate;
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($col == 2){
|
||||
$cc = preg_replace('/\s+/', '',trim($cc));
|
||||
if(!preg_match("@^[a-zA-Z0-9\-\s/.]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = 'GST INVOICE NO';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
// else
|
||||
$td_gst_inv = $cc;
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
//change
|
||||
else if($col == 3){
|
||||
// print_r($cc);
|
||||
if($cc != "CRN" && $cc != "INV" && $cc != "REISSUE"){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = 'DOC TYPE';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 6){
|
||||
if(!preg_match("@^[a-zA-Z\s]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '6-7';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
//CHANGE
|
||||
else if($col == 7){
|
||||
if(!preg_match("@^[a-zA-Z\s0-9]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '6-7';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 12){
|
||||
if(!preg_match("@^[a-zA-Z]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '12';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 16 || $col == 17){
|
||||
if(!preg_match("@^[a-zA-Z0-9]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '16-17';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 8){
|
||||
if(!preg_match("/[a-zA-Z0-9 ]/",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '16-17';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 13 /* || $col == 14 */){
|
||||
if(!preg_match("@^[0-9\-]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '13-14';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
//change
|
||||
else if($col == 14){
|
||||
if(!preg_match("@^[0-9\.-]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '13-14';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else if($col == 11){
|
||||
if(!preg_match("@^[0-9\-/:\s]+$@",$cc)){
|
||||
$seterror = 1;
|
||||
$ferror[$row]['column'][] = '11';
|
||||
$ferror[$row]['row'] = $row;
|
||||
}
|
||||
$values .= '"'.$cc.'",';
|
||||
}
|
||||
else{
|
||||
$values .= '"'.$cell.'",';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$chk = $this->db->query('select * from tmc_data where td_gst_inv = "'.$td_gst_inv.'"');
|
||||
|
||||
if($chk->num_rows()>0){
|
||||
$inserror++;
|
||||
}
|
||||
// print_r($ferror);
|
||||
$insArym[] = 'insert into tmc_data_dump ('.substr($keys,0,-1).',td_tfid) values ('.substr($values,0,-1);
|
||||
$insAry[] = 'insert ignore into tmc_data ('.substr($keys,0,-1).',td_tfid) values ('.substr($values,0,-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ferror = array_values($ferror);
|
||||
// print_r($ferror);
|
||||
// $rdata['status'] = 0;
|
||||
// $rdata['error'] = $ferror;
|
||||
// echo json_encode($rdata);
|
||||
// exit;
|
||||
|
||||
$insdata['f_corporateid'] = $this->session->userdata['recon_sess_i']['u_corporateid'];
|
||||
$insdata['f_file'] = $filename;
|
||||
$insdata['f_type'] = 'tmc';
|
||||
$insdata['f_status'] = 'Initiated';
|
||||
$insdata['f_uploadedby'] = $this->session->userdata['recon_sess_i']['u_id'];
|
||||
$insdata['f_uploadedat'] = date('Y-m-d H:i:s',time());
|
||||
$this->db->insert('files',$insdata);
|
||||
$td_tfid = $this->db->insert_id();
|
||||
$rdata['insref'] = $td_tfid;
|
||||
|
||||
for($c=0;$c<count($insArym);$c++){
|
||||
// try{
|
||||
$this->db->query($insArym[$c].',"'.$td_tfid.'")');
|
||||
// }
|
||||
// catch(Exception $e){
|
||||
// continue;
|
||||
// }
|
||||
}
|
||||
|
||||
if(!empty($ferror)){
|
||||
|
||||
$rdata['duprecords'] = 0;
|
||||
$rdata['status'] = 0;
|
||||
// $rdata['error'] = $ferror;
|
||||
|
||||
if($inserror != 0)
|
||||
$rdata['duprecords'] = $inserror;
|
||||
$rdata['ttlrows'] = $ttlrows;
|
||||
// $rdata['error'] = $ferror;
|
||||
$rdata['invalidrows'] = count($ferror);
|
||||
echo json_encode($rdata); exit;
|
||||
}
|
||||
else{
|
||||
|
||||
$reccnt = $highestRow;
|
||||
$inscnt = 0;
|
||||
|
||||
for($c=0;$c<count($insAry);$c++){
|
||||
try{
|
||||
// print_r($td_tfid);
|
||||
// print_r($insAry[$c].',"'.$td_tfid.'")');die();
|
||||
$this->db->query($insAry[$c].',"'.$td_tfid.'")');
|
||||
if($this->db->affected_rows())
|
||||
$inscnt++;
|
||||
}
|
||||
catch(Exception $e){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$datequery = $this->db->query('select min(td_inv_date) mindate, max(td_inv_date) maxdate from tmc_data where td_tfid = '.$td_tfid);
|
||||
$dateAry = array();
|
||||
foreach($datequery->result() as $dateq){
|
||||
$dateCon['f_id'] = $td_tfid;
|
||||
$dateAry['f_min_date'] = $dateq->mindate;
|
||||
$dateAry['f_max_date'] = $dateq->maxdate;
|
||||
}
|
||||
$this->db->where($dateCon);
|
||||
$this->db->update('files',$dateAry);
|
||||
|
||||
$rdata['status'] = 1;
|
||||
$rdata['added_records'] = $inscnt;
|
||||
echo json_encode($rdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
22
application/models/Tmc_model.php
Normal file
22
application/models/Tmc_model.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Tmc_model extends CI_Model {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function get_user($con = null){
|
||||
if($con)
|
||||
$this->db->where($con);
|
||||
return $this->db->get('users');
|
||||
}
|
||||
|
||||
function get_corp($con=null,$c_id = null,$is_active = null){
|
||||
if($c_id)
|
||||
$con['c_id'] = $c_id;
|
||||
if($is_active)
|
||||
$con['c_isactive'] = 1;
|
||||
return $this->db->get_where('corporates',$con);
|
||||
}
|
||||
}
|
||||
@ -160,6 +160,7 @@
|
||||
<option value="">--Select--</option>
|
||||
<option value="internal">Internal</option>
|
||||
<option value="corporate">Corporate</option>
|
||||
<option value="tmc">TMC</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -240,6 +241,7 @@
|
||||
<option value="">--Select--</option>
|
||||
<option value="internal">Internal</option>
|
||||
<option value="corporate">Corporate</option>
|
||||
<option value="tmc">TMC</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -318,6 +320,7 @@
|
||||
}
|
||||
}
|
||||
var form = $(this);
|
||||
console.log('322',form);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php echo base_url('admin/upd_usrdetail'); ?>',
|
||||
@ -350,6 +353,7 @@
|
||||
return false;
|
||||
}
|
||||
var form = $(this);
|
||||
console.log('355',form);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php echo base_url('admin/add_usrdetail'); ?>',
|
||||
@ -391,7 +395,7 @@
|
||||
$('#e_u_corporateid').val(pd[0].u_corporateid);
|
||||
$('#e_u_role').val(pd[0].u_role);
|
||||
|
||||
if($('#e_u_role').val() == 'corporate')
|
||||
if($('#e_u_role').val() == 'corporate' || $('#e_u_role').val() == 'tmc')
|
||||
{
|
||||
$('#e_corp_div').show();
|
||||
$("#e_u_corporateid").prop('required',true);
|
||||
@ -488,7 +492,7 @@
|
||||
|
||||
$('#e_u_role').on('change',function(){
|
||||
var utype = this.value;
|
||||
if(utype == 'corporate'){
|
||||
if(utype == 'corporate' || utype == 'tmc'){
|
||||
$('#e_u_corporateid').prop('disabled',false);
|
||||
$('#e_corp_div').show();
|
||||
}
|
||||
@ -502,7 +506,7 @@
|
||||
var utype = this.value;
|
||||
var htmlData = '<option value="">--Select--</option>';
|
||||
// var htmlData = '<vadd_u_corporateid'
|
||||
if(utype == 'corporate'){
|
||||
if(utype == 'corporate' || utype == 'tmc'){
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('admin/get_corp'); ?>',
|
||||
type:'POST',
|
||||
|
||||
@ -650,6 +650,7 @@
|
||||
url: url,
|
||||
success: function(data)
|
||||
{
|
||||
console.log("111");
|
||||
oTable.clear();
|
||||
var jsonData = JSON.parse(data);
|
||||
var jd = jsonData.data;
|
||||
|
||||
@ -655,6 +655,7 @@
|
||||
type: "POST",
|
||||
url: url,
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
if(data.length > 2){
|
||||
oTable.clear();
|
||||
var jsonData = JSON.parse(data);
|
||||
|
||||
20
application/views/tmc/includes/footer.php
Normal file
20
application/views/tmc/includes/footer.php
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- Footer Start -->
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>document.write(new Date().getFullYear())</script> © <a href="">TravelSpends</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- end Footer -->
|
||||
102
application/views/tmc/includes/top_nav.php
Normal file
102
application/views/tmc/includes/top_nav.php
Normal file
@ -0,0 +1,102 @@
|
||||
<!-- Topbar Start -->
|
||||
<div class="navbar-custom">
|
||||
<div class="container-fluid">
|
||||
|
||||
<ul class="list-unstyled topnav-menu float-right mb-0">
|
||||
|
||||
<li class="dropdown notification-list topbar-dropdown">
|
||||
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
|
||||
<img src="<?php echo base_url(); ?>assets/images/users/avatar-1.jpg" alt="user-image" class="rounded-circle">
|
||||
<span class="pro-user-name ml-1">
|
||||
<?php echo $this->session->userdata['recon_sess_i']['u_name']; ?> <i class="mdi mdi-chevron-down"></i>
|
||||
</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right profile-dropdown ">
|
||||
<!-- item-->
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow m-0">Welcome !</h6>
|
||||
</div>
|
||||
|
||||
<!-- item-->
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-settings-3-line"></i>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<!-- item-->
|
||||
<a href="<?php echo base_url('logout'); ?>" class="dropdown-item notify-item">
|
||||
<i class="ri-logout-box-line"></i>
|
||||
<span>Logout</span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!--
|
||||
<li class="dropdown notification-list">
|
||||
<a href="javascript:void(0);" class="nav-link right-bar-toggle waves-effect waves-light">
|
||||
<i class="fe-settings noti-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
-->
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="<?php echo base_url('internal'); ?>" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?php echo base_url(); ?>assets/images/tsplogin.png" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">Minton</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url(); ?>assets/images/tsplogin.png" alt="" height="30">
|
||||
<!-- <span class="logo-lg-text-light">M</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo base_url('internal'); ?>" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?php echo base_url(); ?>assets/images/tsplogin.png" alt="" height="24">
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?php echo base_url(); ?>assets/images/tsplogin.png" alt="" height="30">
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end Topbar -->
|
||||
|
||||
<div class="topnav">
|
||||
<div class="container-fluid">
|
||||
<nav class="navbar navbar-light navbar-expand-lg topnav-menu">
|
||||
<div class="collapse navbar-collapse" id="topnav-menu-content">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-dashboard" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="ri-dashboard-line mr-1"></i> Files <div class="arrow-down"></div>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-dashboard">
|
||||
<a href="<?php echo site_url('tmc/tmc'); ?>" class="dropdown-item">TMC</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-dashboard" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="ri-pages-line mr-1"></i> Reconciliation <div class="arrow-down"></div>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-dashboard">
|
||||
<a href="<?php echo site_url('tmc/tmc_recon'); ?>" class="dropdown-item">TMC</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul> <!-- end navbar-->
|
||||
</div> <!-- end .collapsed-->
|
||||
</nav>
|
||||
</div> <!-- end container-fluid -->
|
||||
</div> <!-- end topnav-->
|
||||
690
application/views/tmc/tmc.php
Normal file
690
application/views/tmc/tmc.php
Normal file
@ -0,0 +1,690 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TMC File Listing</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
||||
<meta content="Coderthemes" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- App favicon -->
|
||||
<!-- <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/images/favicon.ico">-->
|
||||
<link rel='shortcut icon' href=assets/images/tsplogo2.png>
|
||||
|
||||
<!-- third party css -->
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- third party css end -->
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
|
||||
<!-- icons -->
|
||||
<link href="<?php echo base_url(); ?>assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?php echo base_url(); ?>assets/js/vendor.min.js"></script>
|
||||
|
||||
<style>
|
||||
.mb25 {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.required {
|
||||
color: red;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'>
|
||||
|
||||
<!-- Begin page -->
|
||||
<div id="wrapper">
|
||||
|
||||
<?php include('includes/top_nav.php'); ?>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">TMC File Listing</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Files</a></li>
|
||||
<li class="breadcrumb-item active">TMC File Listing</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-2">
|
||||
<a class="btn btn-primary waves-effect waves-light" style="float:right" href="<?php echo base_url('corporate/tmc_sample_download') ?>" target="_blank"><i class="fa fa-download"></i> Sample</a>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button style="float:right" type="button" class="btn btn-primary waves-effect waves-light" data-toggle='modal' data-target="#add_modal"><i class="fa fa-upload"></i> Upload TMC Data</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<h4 class="header-title">Scroll - Horizontal</h4>
|
||||
<p class="text-muted font-13 mb-4">
|
||||
DataTables has the ability to show tables with horizontal scrolling, which is very useful for when you have a wide
|
||||
table, but want to constrain it to a limited horizontal display area.
|
||||
</p>
|
||||
-->
|
||||
|
||||
<table id="datatable" class="table w-100 nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Agent</th>
|
||||
<th>For Month</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
<th>Uploaded By</th>
|
||||
<th>Email</th>
|
||||
<th>Uploaded On</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
|
||||
</div> <!-- container -->
|
||||
|
||||
</div> <!-- content -->
|
||||
|
||||
<?php include('includes/footer.php'); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- End Page content -->
|
||||
<!-- ============================================================== -->
|
||||
</div>
|
||||
<div id="add_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Upload TMC File</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<form id="usrforma" enctype="multipart/form-data" class="form-horizontal editform" style="padding:10px;">
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<!-- <div class="row"> -->
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Agent<span class="required">*</span></label>
|
||||
<input value="testagent" onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[f_agent]" id="" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Year<span class="required">*</span></label>
|
||||
<select required id="yearselect" class="form-control" name="usr[f_year]" onchange="showmonths(this.value)">
|
||||
<option value="">Select Year</option>
|
||||
<?php
|
||||
foreach($years as $yr){
|
||||
echo '<option value="'.$yr.'">'.$yr.'</option>';
|
||||
// echo '<option '.(($curYear==$yr?"selected='selected'":"")).' value="'.$yr.'">'.$yr.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="curyear" class="col-md-6 mb25">
|
||||
<label>Month<span class="required">*</span></label>
|
||||
<select id="scuryear" name="usr[f_month]" class="form-control">
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
$c=0;
|
||||
foreach($month as $am){
|
||||
echo '<option value="'.++$c.'">'.$am.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<script>
|
||||
$('#scuryear').val(5);
|
||||
$('#yearselect').val(2020);
|
||||
|
||||
</script>
|
||||
<div id="otheryear" class="col-md-6 mb25" style="display:none">
|
||||
<label>Month<span class="required">*</span></label>
|
||||
<select disabled id="sotheryear" name="usr[f_month]" class="form-control">
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
$c=0;
|
||||
foreach($allmonth as $am){
|
||||
echo '<option value="'.++$c.'">'.$am.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb25">
|
||||
<label>File<span class="required">*</span></label>
|
||||
<input required type="file" name="tmc_file" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button class="btn btn-primary" type="button" id="loading1" style="display:none">
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Loading...
|
||||
</button>
|
||||
<button type="submit" id="submit1" class="btn btn-primary">Submit</button>
|
||||
<button type="button" id="addclose" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="responsemref" style="display:none" type="button" data-toggle='modal' data-target="#response_modal"><i class="fa fa-upload"></i> Upload TMC Data</button>
|
||||
|
||||
<div id="response_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Upload Process</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<form id="usrforme" class="form-horizontal editform" style="padding:10px;">
|
||||
<input type="hidden" name="fileref" id="fileref" />
|
||||
<div class="modal-body">
|
||||
<div id="responsecontent"></div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!--<button type="submit" class="btn btn-primary">Submit</button>-->
|
||||
|
||||
|
||||
<button disabled class="btn btn-primary" type="button" id="loading2" style="display:none">
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Loading...
|
||||
</button>
|
||||
|
||||
<button type="button" id="proceedbtn" class="btn btn-default btn-secondary" data-dismiss="modal">Proceed</button>
|
||||
<button type="button" id="reupload" class="btn btn-default btn-primary" data-dismiss="modal">Upload again</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Edit Corporate Details</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<form id="usrforme" class="form-horizontal editform" style="padding:10px;">
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Company Name<span class="required">*</span></label>
|
||||
<input type="hidden" name="c_id" id="e_c_id" class="form-control" />
|
||||
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_name]" id="e_c_name" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Short Name<span class="required">*</span></label>
|
||||
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_code]" id="e_c_code" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Contact Person<span class="required">*</span></label>
|
||||
<input onkeyup="this.value = this.value.toUpperCase();" required type="text" name="usr[c_person]" id="e_c_person" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Email<span class="required">*</span></label>
|
||||
<input type="text" name="usr[c_email]" id="e_c_email" class="form-control" required />
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mb25">
|
||||
<label>Mobile</label>
|
||||
<input type="text" oninput="this.setCustomValidity('')" oninvalid="this.setCustomValidity('Valid format : 10 digit number')" pattern="[0-9]{10}" name="usr[c_number]" id="e_c_number" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>Status<span class="required">*</span></label> <br />
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="usr[c_isactive]" id="e_c_isactive_1" value="1" required> Active
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="usr[c_isactive]" id="e_c_isactive_0" value="0"> Deactive
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="button" id="editclose" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button style="display:none" id="editref" type="button" class="btn btn-primary" data-toggle='modal' data-target="#edit_modal">edit ref</button>
|
||||
<!-- END wrapper -->
|
||||
|
||||
<div class="modal" id="download_modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<!-- <h4 class="modal-title">Forgot Password</h4> -->
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form method="post" action="<?php echo base_url('Corporate/d_record_tmc'); ?>" target="_blank" id="dform1" class="form-horizontal" style="padding:10px;">
|
||||
<input type="hidden" id="id" name="id" value=""/>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Select Record Type</label>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" id="type" name="type" required>
|
||||
<option>--select--</option>
|
||||
<option value="Raw">Raw</option>
|
||||
<option value="Validated">Validated</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" style="margin-top:20px;">
|
||||
<button type="submit" id="download" class="btn btn-primary">Download</button>
|
||||
<button type="button" class="btn btn-danger" id="btn_close" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- third party js -->
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.html5.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.flash.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.print.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-select/js/dataTables.select.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/pdfmake.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/vfs_fonts.js"></script>
|
||||
<!-- third party js ends -->
|
||||
|
||||
<!-- Datatables init -->
|
||||
<!-- <script src="<?php echo base_url(); ?>assets/js/pages/datatables.init.js"></script>-->
|
||||
|
||||
<script>
|
||||
$('#reupload').on('click',function(){
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('corporate/deltmc_data'); ?>',
|
||||
data:{fileref:$('#fileref').val()},
|
||||
type:'POST',
|
||||
success:function(data){
|
||||
location.reload();
|
||||
},
|
||||
error:function(){
|
||||
alert('Kindy try after sometime.');
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#proceedbtn').on('click',function(){
|
||||
|
||||
$('#loading2').show();
|
||||
$('#proceedbtn').hide();
|
||||
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('corporate/proceedinsert_tmc'); ?>',
|
||||
data:{fileref:$('#fileref').val()},
|
||||
type:'POST',
|
||||
success:function(data){
|
||||
|
||||
$('#loading2').show();
|
||||
$('#proceedbtn').hide();
|
||||
|
||||
var pdata = JSON.parse(data);
|
||||
if (pdata.status == 1) {
|
||||
$('#addclose').trigger('click');
|
||||
usrforma.reset();
|
||||
alert('File uploaded successfully.');
|
||||
// getcorplisting();
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert('Kindly try after sometime.');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function showmonths(year) {
|
||||
var d = new Date();
|
||||
var n = d.getFullYear();
|
||||
if (year == n) {
|
||||
$('#curyear').show();
|
||||
$('#scuryear').prop('required', true);
|
||||
$('#scuryear').prop('disabled', false);
|
||||
$('#sotheryear').prop('disabled', true);
|
||||
$('#otheryear').hide();
|
||||
} else {
|
||||
$('#curyear').hide();
|
||||
$('#sotheryear').prop('required', true);
|
||||
$('#sotheryear').prop('disabled', false);
|
||||
$('#scuryear').prop('disabled', true);
|
||||
$('#otheryear').show();
|
||||
}
|
||||
}
|
||||
|
||||
$("#usrforme").submit(function(e) {
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
var form = $(this);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php echo base_url('admin/upd_corpdetail'); ?>',
|
||||
data: form.serialize(), // serializes the form's elements.
|
||||
success: function(data) {
|
||||
if (data == 1) {
|
||||
$('#editclose').trigger('click');
|
||||
usrforme.reset();
|
||||
alert('Corporate details updated successfully.');
|
||||
getcorplisting();
|
||||
} else if (data == 2) {
|
||||
alert('Error. Corporate code already exists.');
|
||||
} else if (data == 3) {
|
||||
alert('Error. Email ID already exists.');
|
||||
} else {
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#usrforma").submit(function(e) {
|
||||
|
||||
$('#loading1').show();
|
||||
$('#submit1').hide();
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
// var form = $(this);
|
||||
var formData = new FormData($("#usrforma")[0]);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?php echo base_url('tmc/upload_tmc'); ?>',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
|
||||
$('#loading1').hide();
|
||||
$('#submit1').show();
|
||||
|
||||
var pdata = JSON.parse(data);
|
||||
if (pdata.status == 1) {
|
||||
$('#addclose').trigger('click');
|
||||
usrforma.reset();
|
||||
alert('File uploaded successfully.');
|
||||
// alert('File uploaded successfully. Records insertred - ' + pdata.added_records);
|
||||
// getcorplisting();
|
||||
location.reload();
|
||||
} else if (pdata.status == 31) {
|
||||
alert('File already uploaded for this criteria.');
|
||||
} else if (pdata.status == 13) {
|
||||
alert('Error. Column mismatch.');
|
||||
} else if (pdata.status == 0) {
|
||||
$('#fileref').val(pdata.insref);
|
||||
var content = 'Total Records - '+pdata.ttlrows+'<br/>Invalid Records - '+pdata.invalidrows;
|
||||
if(pdata.duprecords != 0)
|
||||
content += '<br/>Duplicate Records - '+pdata.duprecords;
|
||||
// var content = 'Error in <br/>';
|
||||
// var row = 1;
|
||||
// $.each(pdata.error, function(k, v){
|
||||
// $.each(v, function(kk, vv) {
|
||||
// var l = 0;
|
||||
// if (kk == 'column') {
|
||||
// if (l == 0) {
|
||||
// content += 'Row ' + row + ' - ';
|
||||
// l = l + 1;
|
||||
// }
|
||||
// for (var i = 0; i < vv.length; i++) {
|
||||
// content += vv[i] + ',';
|
||||
// }
|
||||
// content += '<br/>';
|
||||
// row = row + 1;
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
$('#addclose').trigger('click');
|
||||
$('#responsecontent').html(content+'<br/><span style="color:red">*</span>Note : If you proceed only valid records will be uploaded.');
|
||||
$('#responsemref').trigger('click');
|
||||
|
||||
// console.log(content);
|
||||
// var content='Error in \n';
|
||||
// $.each(pdata.error,function(k,v){
|
||||
// var sary = v.split('-');
|
||||
// content += 'Row '+sary[0]+' - Column - '+sary[1]+'\n';
|
||||
// })
|
||||
// content += 'Kindly correct the data and upload';
|
||||
// alert(content);
|
||||
} else {
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function editfn(c_id) {
|
||||
$('#e_c_id').val(c_id);
|
||||
var htmlData = '';
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('admin/get_corpdetail') ?>',
|
||||
data: {
|
||||
c_id: c_id
|
||||
},
|
||||
type: 'POST',
|
||||
success: function(data) {
|
||||
var pdata = JSON.parse(data);
|
||||
var pd = pdata.data;
|
||||
$('#e_c_name').val(pd[0].c_name);
|
||||
$('#e_c_email').val(pd[0].c_email);
|
||||
$('#e_c_number').val(pd[0].c_number);
|
||||
$('#e_c_person').val(pd[0].c_person);
|
||||
$('#e_c_code').val(pd[0].c_code);
|
||||
|
||||
$.each(pd[0], function(k, v) {
|
||||
if (k == 'c_isactive') {
|
||||
console.log(v);
|
||||
if ((v == '0') || (v == '1')) {
|
||||
$('#e_' + k + '_' + v).prop('checked', true);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function() {
|
||||
alert('Request failed. Kindly try after sometime.');
|
||||
}
|
||||
});
|
||||
$('#editref').trigger('click');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
oTable = $('#datatable').DataTable({
|
||||
dom: '<"top"Bf>rt<"bottom"ip><"clear">',
|
||||
// dom:'B',
|
||||
'lengthChange': false,
|
||||
"columnDefs": [{
|
||||
"targets": 7,
|
||||
"width": "12%",
|
||||
"render": function(data, type, full, meta) {
|
||||
// return '<a target="_blank" href="<?php echo base_url('corporate/tmc_file_download/'); ?>' + data + '" style="font-size:16px;"><i class="fa fa-download" title="Download file"></i></a> <a target="_blank" href="<?php echo base_url('corporate/tmc_valid_download/'); ?>'+data+'" style="font-size:16px;color:green"><i class="fa fa-download" title="Download Valid Records"></i></a>';
|
||||
|
||||
return '<a href="javascript:void(0)" onclick="downloadfn('+data+')" style="font-size:16px;"><i class="fa fa-download" title="Download file"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// <a href='' style="font-size:16px;"><i class="fa fa-trash"></i> </a>
|
||||
],
|
||||
// order : [[ 4, "asc" ]],
|
||||
columns: [
|
||||
// { data : "c_name"},
|
||||
{
|
||||
data: "f_agent"
|
||||
},
|
||||
{
|
||||
data: "inv_ref"
|
||||
},
|
||||
{
|
||||
data: "f_min_date_ref"
|
||||
},
|
||||
{
|
||||
data: "f_max_date_ref"
|
||||
},
|
||||
{
|
||||
data: "u_name"
|
||||
},
|
||||
{
|
||||
data: "u_email"
|
||||
},
|
||||
{
|
||||
data: "f_uploadedat_ref"
|
||||
},
|
||||
{
|
||||
data: "f_id"
|
||||
}
|
||||
],
|
||||
buttons: ['excel']
|
||||
// buttons: ['copy', 'excel', 'pdf']
|
||||
});
|
||||
getcorplisting();
|
||||
});
|
||||
|
||||
function getcorplisting() {
|
||||
var url = "<?php echo site_url('corporate/get_tmc'); ?>"; // the script where you handle the form input.
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
success: function(data) {
|
||||
if(data.length > 2){
|
||||
oTable.clear();
|
||||
var jsonData = JSON.parse(data);
|
||||
var jd = jsonData.data;
|
||||
var htmlData = '';
|
||||
var i = 0;
|
||||
var rowNode = oTable
|
||||
.rows.add(jsonData.data)
|
||||
.draw();
|
||||
$('#wait').hide();
|
||||
}
|
||||
// $('#example1_filter').hide();
|
||||
// $('#dtableid').show();
|
||||
// get_all_pnr_counts();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function downloadfn(val)
|
||||
{
|
||||
var id = val;
|
||||
$('#id').val(id);
|
||||
$('#download_modal').modal('show');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?php echo base_url(); ?>assets/js/app.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
591
application/views/tmc/tmc_recon.php
Normal file
591
application/views/tmc/tmc_recon.php
Normal file
@ -0,0 +1,591 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>TMC Recon</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
||||
<meta content="Coderthemes" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- App favicon -->
|
||||
<!-- <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/images/favicon.ico">-->
|
||||
<link rel='shortcut icon' href=assets/images/tsplogo2.png>
|
||||
|
||||
<!-- third party css -->
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo base_url(); ?>assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- third party css end -->
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?php echo base_url(); ?>assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?php echo base_url(); ?>assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
|
||||
<!-- icons -->
|
||||
<link href="<?php echo base_url(); ?>assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style>
|
||||
.mb25{
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.required{
|
||||
color: red;
|
||||
}
|
||||
#bs-select-1{
|
||||
max-height: 150px !important;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": true}'>
|
||||
|
||||
<!-- Begin page -->
|
||||
<div id="wrapper">
|
||||
|
||||
<?php include('includes/top_nav.php'); ?>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">TMC</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Reconciliation</a></li>
|
||||
<li class="breadcrumb-item active">TMC</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row" style="margin-bottom:20px;">
|
||||
<form class="col-md-12" id="formid">
|
||||
<div class="form-row">
|
||||
<!--
|
||||
<div class="form-group col-md-2">
|
||||
<label for="inputEmail4" class="col-form-label">GST No</label>
|
||||
<select name="gst_no" class="form-control">
|
||||
<?php
|
||||
// foreach($gstno_list->result() as $gstno_i){
|
||||
// echo '<option>'.$gstno_i->gn_gstno.'</option>';
|
||||
// }
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
-->
|
||||
<div class="form-group col-md-2">
|
||||
<label for="inputEmail4" class="col-form-label">From</label>
|
||||
<input name="fromdate" value="2017-01-01" type="date" class="form-control" id="" placeholder="Email">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="inputPassword4" class="col-form-label">To</label>
|
||||
<input name="todate" value="2021-01-01" type="date" class="form-control" id="" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="inputPassword4" class="col-form-label"></label>
|
||||
<button style="margin-top:35px" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
<div class="form-group col-md-4" style="margin-top:35px;">
|
||||
<select style="overflow-y:scroll" name="column_name" id="column_name" class="form-control selectpicker" multiple>
|
||||
<option value="0">SEGMENT</option>
|
||||
<option value="1">INV DATE </option>
|
||||
<option value="2">GST INVOICE NO</option>
|
||||
<option value="3">REF NO</option>
|
||||
<option value="4">DOC TYPE</option>
|
||||
<option value="5">BILLING ENTITY</option>
|
||||
<option value="6">PASSENGER NAME</option>
|
||||
<option value="7">AIRLINE CODE</option>
|
||||
<option value="8">TICKET NO</option>
|
||||
<option value="9">SECTOR</option>
|
||||
<option value="10">CABINCLASS</option>
|
||||
<option value="11">TOTAL TKT FARE</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>SEGMENT</th>
|
||||
<th>INV DATE</th>
|
||||
<th>GST INVOICE NO</th>
|
||||
<th>REF NO</th>
|
||||
<th>DOC TYPE</th>
|
||||
<th>BILLING ENTITY</th>
|
||||
<th>PASSENGER NAME</th>
|
||||
<th>AIRLINE CODE</th>
|
||||
<th>TICKET NO</th>
|
||||
<th>SECTOR</th>
|
||||
<th>CABINCLASS</th>
|
||||
<th>TOTAL TKT FARE</th>
|
||||
<th>REMARKS</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
|
||||
</div> <!-- container -->
|
||||
|
||||
</div> <!-- content -->
|
||||
<input type="hidden" id="refval" />
|
||||
<input type="hidden" id="refval_gst_tkt" />
|
||||
<?php include('includes/footer.php'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button id="view_modal_btn" style="display:none" type="button" data-toggle='modal' data-target="#view_modal"><i class="fa fa-upload"></i> View modal</button>
|
||||
|
||||
<div id="view_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Associated Inovice Files</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<form id="usrforma" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div id="modalContent"></div>
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<div class="row" id="fieldcontent">
|
||||
<div class="col-md-12" id="fielddiv1">
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb25" id="">
|
||||
<label>GST Inv Number<span class="required">*</span></label>
|
||||
<input class="col-md-10" id="gstno_0" required type="text" name="in[0][gst_nub]"/> <a href="javascript:void(0)" onclick="getGstAmt(0)"><i class="fa fa-search"></i></a>
|
||||
</div>
|
||||
<div class="col-md-2 mb25" id="">
|
||||
<label>Amount<span class="required">*</span></label>
|
||||
<input readonly class="col-md-12" id="amtid_0" required type="text" name="in[0][amount]"/>
|
||||
<input class="col-md-12" id="manual_0" value="1" required type="hidden" name="in[0][manual]"/>
|
||||
<input class="col-md-12" id="gdid_0" value="" required type="hidden" name="in[0][gdid]"/>
|
||||
</div>
|
||||
<div class="col-md-3 mb25">
|
||||
<label>Airline Invoice<span class="required" id="fileidspan_0">*</span></label>
|
||||
<input id="fileid_0" required type="file" name="in[0][invfile]"/>
|
||||
</div>
|
||||
<div class="col-md-2 mb25">
|
||||
<label>File</label>
|
||||
<div id="airline_invoice_0"></div>
|
||||
</div>
|
||||
<div class="col-md-1 mb25">
|
||||
<a id="minus1" onclick="removeinputs(1)" style="margin-top:20px;color:red" class="btn btn-default"><i class="fa fa-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="tmc_ref" name="tmc_ref" value="" />
|
||||
<div class="row" id="">
|
||||
<div class="col-md-10">
|
||||
</div>
|
||||
<div class="col-md-2 mb25">
|
||||
<a id="addfields" onclick="addfields()" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button class="btn btn-primary" type="submit" id="formsubmit">Submit
|
||||
</button>
|
||||
<button type="button" id="addclose" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="counter" name="counter" value="1" />
|
||||
<!-- ============================================================== -->
|
||||
<!-- End Page content -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?php echo base_url(); ?>assets/js/vendor.min.js"></script>
|
||||
|
||||
<!-- third party js -->
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.html5.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.flash.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-buttons/js/buttons.print.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/datatables.net-select/js/dataTables.select.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/pdfmake.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/libs/pdfmake/build/vfs_fonts.js"></script>
|
||||
|
||||
|
||||
<!-- <script src="<?php echo base_url(); ?>assets/js/pages/datatables.init.js"></script> -->
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?php echo base_url(); ?>assets/js/app.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$('#usrforma').on('submit',function(e){
|
||||
e.preventDefault();
|
||||
var formData = new FormData( $("#usrforma")[0] );
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'<?php echo base_url('corporate/add_tmc_airline_invoices') ?>',
|
||||
data:formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
async: false,
|
||||
success:function(data){
|
||||
htmlData = '<div class="col-md-12" id="fielddiv1">'+
|
||||
'<div class="row">'+
|
||||
'<div class="col-md-4 mb25" id="">'+
|
||||
'<label>GST Inv Number<span class="required">*</span></label>'+
|
||||
'<input class="col-md-10" required id="gstno_0" type="text" name="in[0][gst_nub]"/> <a href="javascript:void(0)" onclick="getGstAmt(0)"><i class="fa fa-search"></i></a>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25" id="">'+
|
||||
'<label>Amount<span class="required">*</span></label>'+
|
||||
'<input class="col-md-12" id="amtid_0" required type="text" name="in[0][amount]"/>'+
|
||||
'<input class="col-md-12" id="manual_0" value="1" required type="hidden" name="in[0][manual]"/>'+
|
||||
'<input class="col-md-12" id="gdid_0" value="" required type="hidden" name="in[0][gdid]"/>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-3 mb25">'+
|
||||
'<label>Airline Invoice<span class="required" id="fileidspan_0">*</span></label>'+
|
||||
'<input id="fileid_0" required type="file" name="in[0][invfile]"/>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<label>File</label>'+
|
||||
'<div id="airline_invoice_0"></div>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-1 mb25">'+
|
||||
'<a id="minus1" onclick="removeinputs(1)" style="margin-top:20px;color:red" class="btn btn-default"><i class="fa fa-trash"></i></a>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
$('#fieldcontent').html(htmlData);
|
||||
viewfn(data,0);
|
||||
},
|
||||
error:function(){
|
||||
alert('Request failed.');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function removeinputs(id){
|
||||
$('#fielddiv'+id).remove();
|
||||
}
|
||||
|
||||
function getGstAmt(refid){
|
||||
if($('#gstno_'+refid).val() != ''){
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('corporate/getgstamt'); ?>',
|
||||
type:'POST',
|
||||
data:{refid:$('#gstno_'+refid).val()},
|
||||
success:function(data){
|
||||
var pdata = JSON.parse(data);
|
||||
if(pdata.status == 1){
|
||||
$('#manual_'+refid).val(0);
|
||||
$('#amtid_'+refid).val(pdata.amt);
|
||||
$('#gdid_'+refid).val(pdata.gdid);
|
||||
$('#amtid_'+refid).prop('readonly',true);
|
||||
if(pdata.ti_file_name != ''){
|
||||
$('#airline_invoice_'+refid).html('<a href="javascript:void(0)" onclick="tmcinvdownload(\''+pdata.ti_file_name+'\')"/><i class="fa fa-download"></i></a>');
|
||||
$('#fileid_'+refid).prop('required',false);
|
||||
$('#fileidspan_'+refid).hide();
|
||||
}
|
||||
else{
|
||||
$('#airline_invoice_'+refid).html('');
|
||||
$('#fileid_'+refid).prop('required',true);
|
||||
$('#fileidspan_'+refid).show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#manual_'+refid).val(1);
|
||||
$('#amtid_'+refid).val('');
|
||||
$('#gdid_'+refid).val('');
|
||||
$('#amtid_'+refid).prop('readonly',false);
|
||||
$('#airline_invoice_'+refid).html('');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function tmcinvdownload(refid){
|
||||
window.location = '<?php echo base_url('corporate/download_airline_invoice/'); ?>'+refid
|
||||
}
|
||||
|
||||
function addfields(){
|
||||
var c = parseInt($('#counter').val()) + 1;
|
||||
$('#counter').val(c);
|
||||
var r = c - 1;
|
||||
var htmlData = '<div class="col-md-12" id="fielddiv'+c+'">'+
|
||||
'<div class="row">'+
|
||||
'<div class="col-md-4 mb25" id="">'+
|
||||
'<label>GST Inv Number<span class="required">*</span></label>'+
|
||||
'<input class="col-md-10" id="gstno_'+r+'" required type="text" name="in['+r+'][gst_nub]"/> <a href="javascript:void(0)" onclick="getGstAmt('+r+')"><i class="fa fa-search"></i></a>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25" id="">'+
|
||||
'<label>Amount<span class="required">*</span></label>'+
|
||||
'<input class="col-md-12" required id="amtid_'+r+'" type="text" name="in['+r+'][amount]"/>'+
|
||||
'<input class="col-md-12" id="manual_'+r+'" value="1" required type="hidden" name="in['+r+'][manual]"/>'+
|
||||
'<input class="col-md-12" id="gdid_'+r+'" value="" required type="hidden" name="in['+r+'][gdid]"/>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-3 mb25">'+
|
||||
'<label>Airline Invoice<span id="fileidspan_'+r+'" class="required">*</span></label>'+
|
||||
'<input id="fileid_'+r+'" required type="file" name="in['+r+'][invfile]"/>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<label>File</label>'+
|
||||
'<div id="airline_invoice_'+r+'"></div>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-1 mb25">'+
|
||||
'<a id="minus1" onclick="removeinputs('+c+')" style="margin-top:20px;color:red" class="btn btn-default"><i class="fa fa-trash"></i></a>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
$('#fieldcontent').append(htmlData);
|
||||
}
|
||||
|
||||
$('#formid').submit(function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('corporate/gen_tmc_recon'); ?>',
|
||||
type:'POST',
|
||||
data:$('#formid').serialize(),
|
||||
success:function(data){
|
||||
oTable.clear();
|
||||
var jsonData = JSON.parse(data);
|
||||
var jd = jsonData.data;
|
||||
var htmlData = '';
|
||||
var i = 0;
|
||||
var rowNode = oTable
|
||||
.rows.add(jsonData.data)
|
||||
.draw();
|
||||
},
|
||||
error:function(){
|
||||
alert('Request failed. Kindly try after sometime.');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function viewfn(tdid,ref){
|
||||
$('#tmc_ref').val(tdid);
|
||||
$.ajax({
|
||||
url:'<?php echo base_url('corporate/get_tmc_airline_invoice'); ?>',
|
||||
type:'POST',
|
||||
data:{tdid:tdid},
|
||||
success:function(data){
|
||||
var htmlData = '';
|
||||
var pdata1 = JSON.parse(data);
|
||||
if(pdata1.status == 1){
|
||||
htmlData = '<div class="row">'+
|
||||
'<div class="col-md-3 mb25">'+
|
||||
'<label>GST Inv Number</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<label>Amount</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<label>Airline Invoice</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-3 mb25">'+
|
||||
'<label>Remarks</label>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
var pdata = pdata1.data;
|
||||
var netttl = 0;
|
||||
$.each(pdata,function(i){
|
||||
netttl += parseInt(pdata[i].ti_amount);
|
||||
var fname = pdata[i].ti_file_name.split('___');
|
||||
htmlData += '<div class="row">'+
|
||||
'<div class="col-md-3 mb25">'+
|
||||
'<label>'+pdata[i].ti_gst_nub+'</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<span>'+pdata[i].ti_amount+'</span>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<div><a href="<?php echo base_url('corporate/download_airline_invoice/') ?>'+pdata[i].ti_file_name+'" target="_blank"><i class="fa fa-download"></i></a></div>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-3 mb25">';
|
||||
if(pdata[i].gd_id == '')
|
||||
htmlData += '<label>Not Filed</label>';
|
||||
else
|
||||
htmlData += '<label>Filed</label>';
|
||||
|
||||
htmlData += '</div>'+
|
||||
'</div>';
|
||||
});
|
||||
|
||||
htmlData += '<div class="row">'+
|
||||
'<div class="col-md-3 mb25"><b>Total</b>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-2 mb25">'+
|
||||
'<span>'+netttl+'</span>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
htmlData += '<hr/>';
|
||||
|
||||
}
|
||||
$('#modalContent').html(htmlData);
|
||||
if(ref == 1)
|
||||
$('#view_modal_btn').click();
|
||||
},
|
||||
error:function(){
|
||||
alert('Request failed. Kindly try after sometime');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
oTable = $("#scroll-horizontal-datatable").DataTable({
|
||||
lengthChange: !1,
|
||||
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: "csvHtml5",
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 23, 24, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ]
|
||||
}
|
||||
}
|
||||
|
||||
// 'copyHtml5',
|
||||
// 'excelHtml5',
|
||||
// 'csvHtml5'
|
||||
// 'pdfHtml5'
|
||||
],
|
||||
scrollX: !0,
|
||||
language: {
|
||||
paginate: {
|
||||
previous: "<i class='mdi mdi-chevron-left'>",
|
||||
next: "<i class='mdi mdi-chevron-right'>"
|
||||
}
|
||||
},
|
||||
drawCallback: function () {
|
||||
$(".dataTables_paginate > .pagination").addClass("pagination-rounded")
|
||||
},
|
||||
columns : [
|
||||
{ data : "td_segment"},
|
||||
{ data : "td_inv_date"},
|
||||
{ data : "td_gst_inv"},
|
||||
{ data : "td_gst_inv"},
|
||||
{ data : "td_doc_type"},
|
||||
{ data : "td_billing_entity"},
|
||||
{ data : "td_pax"},
|
||||
{ data : "td_carrier"},
|
||||
{ data : "td_tkt"},
|
||||
{ data : "td_sector"},
|
||||
{ data : "td_cabin_class"},
|
||||
{ data : "td_tkt_fare"},
|
||||
{ data : "d_remarks"},
|
||||
{ data : "td_id"}
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": [ ],
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"targets": 5,
|
||||
"width": "12%",
|
||||
"render": function ( data, type, full, meta ) {
|
||||
if(data == '')
|
||||
data = '';
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": 6,
|
||||
"width": "12%",
|
||||
"render": function ( data, type, full, meta ) {
|
||||
if(data == '')
|
||||
data = '';
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": 13,
|
||||
"width": 300,
|
||||
"render": function ( data, type, full, meta ) {
|
||||
return '<button type="text" class="form-control" data-refid="'+data+'" value="'+data+'" onclick="viewfn('+data+',1)" >View</button>';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
oTable.buttons().container().appendTo("#scroll-horizontal-datatable_wrapper .col-md-6:eq(0)"), $("#alternative-page-datatable").DataTable({
|
||||
pagingType: "full_numbers",
|
||||
drawCallback: function () {
|
||||
$(".dataTables_paginate > .pagination").addClass("pagination-rounded")
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#column_name').selectpicker();
|
||||
|
||||
$('#column_name').change(function(){
|
||||
|
||||
var all_column = ["0", "1", "2", "3", "4", "5", "6"];
|
||||
|
||||
var remove_column = $('#column_name').val();
|
||||
|
||||
var remaining_column = all_column.filter(function(obj) { return remove_column.indexOf(obj) == -1; });
|
||||
|
||||
oTable.columns(remove_column).visible(false);
|
||||
|
||||
oTable.columns(remaining_column).visible(true);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user