403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2bzend/application/views/scripts/customer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/views/scripts/customer/customer-proposal-prashant.phtml
<?php
$customhelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom');
//$travelPlanStatusName=$customhelper->GetTravelPlanStatusArray(2,'');
$AllLeadStatus = $customhelper->GetTravelPlanStatus(2);
$getPlanTypeArray = $customhelper->getPlanTypeName();
$statusArray = array();
//echo "<pre>";print_r($getPlanTypeArray);die;
$LeadListArr = $this->paginator1;
$statustypenameForExpiredArr = $this->statustypenameForExpiredArr;

$AllLeadQualityStatus=array(array('Id'=>1,'Title'=>'Hot'),array('Id'=>2,'Title'=>'Warm'),array('Id'=>3,'Title'=>'Cold'));
$AllLeadQualityStatusName=array(1=>'hot',2=>'warm',3=>'cold');
?>
<!--Page main section start-->
<section id="min-wrapper" class="active">
    <div id="main-content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <ol class="breadcrumb">
                        <li><a href="#"><i class="fa fa-home"></i></a></li>
                        <li class="active">CRM</li><li class="active">My Proposal ---- <?php echo count($this->paginator); ?></li>
                    </ol>
                    <!--Top breadcrumb start -->
                </div>
            </div>
            <!-- Main Content Element  Start-->
            <div class="row">

                <div class="col-md-12">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title" onclick="$('.minus').trigger('click')"><i class="fa fa-filter"></i> Filter By</h3>
                            <ul class="panel-control">
                                <li><a class="minus <?php if (count($this->searchData) == 0): ?>active <?php endif; ?>" href="javascript:void(0)"><i class="fa <?php if (!empty($this->searchData) ): ?>fa-angle-up large <?php else: ?> fa-angle-down large<?php endif; ?>"></i></a></li>
                            </ul>
                        </div>
                        <div class="panel-body" style="display:<?php if (!empty($this->searchData) ): ?>block <?php else: echo "none";
endif; ?>;">
                            <form class="ls_form" role="form" action="" method="post" autocomplete="off" id="myProposalFilterForm" name="myProposalFilterForm">

                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Customer Name</label>
                                        <input class="form-control whbg" type="text" id="customerName" name="customerName" value="<?php echo $this->searchData['customerName']; ?>"/>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Customer Email</label>
                                        <input class="form-control whbg" type="text" id="customerEmail" name="customerEmail" value="<?php echo $this->searchData['customerEmail']; ?>"/>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Customer Mobile</label>
                                        <input class="form-control whbg" type="text" id="customerName" name="customerMobile" value="<?php echo $this->searchData['customerMobile']; ?>"/>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Proposal Id</label>
                                        <input class="form-control whbg" type="text" id="customerProposalId" name="customerProposalId" value="<?php echo $this->searchData['customerProposalId']; ?>"/>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Source / Destination</label>
<?php echo $this->partial('customer/typeaheadcitysearchdetail.phtml', array('cityDisable' => false, 'countryFieldName' => '', 'validationCityFiledName' => 'Destination', 'textFieldName' => 'CityName', 'textFieldSelectedValue' => @$this->searchData['CityName'], 'cityId' => @$this->searchData['Destination'])); ?> 

                                    </div>
                                </div>
<?php if ($this->isAdmin) { ?>
                                    <div class="col-md-4">
                                        <div class="form-group">
                                            <label>Owner</label>
    <!--                                        <input class="form-control whbg" type="text" id="owner" name="owner" value="<?php //echo $this->searchData['owner'];  ?>" />-->
                                            <select id="owner" name="owner" class="demo-default select-country" placeholder="Select">
                                                <option value="">Select Users</option>
                                                <?php
                                                if (!empty($this->agencyUser) ) {
                                                    foreach ($this->agencyUser as $u => $l) {
                                                        ?>
                                                        <option <?php if ($l['UserSysId'] == $this->searchData['owner']) {
                                                            echo "selected='true'";
                                                        } ?> value="<?php echo trim($l['UserSysId']); ?>" ><?php echo (isset($l['FullName']) && !empty($l['FullName'])) ? stripslashes($l['FullName']) : $l['EmailId']; ?></option>
        <?php }
    }
    ?>


                                            </select>
                                        </div>
                                    </div>
<?php } ?>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label>Stage</label>
                                        <select id="StatusType" name="StatusType" class="demo-default select-country" placeholder="Select" >
                                            <option value="">Stage</option>
                                            <?php
                                            if (!empty($AllLeadStatus)  ) {
                                                foreach ($AllLeadStatus as $key => $val) {
                                                    $statusArray[$val['TPStatusSysId']] = $AllLeadStatus[$key];
                                                    ?>
                                                    <option value="<?php echo stripslashes($val['TPStatusSysId']); ?>" <?php if ($val['TPStatusSysId'] == $this->searchData['StatusType']) {
                                                echo "selected='true'";
                                            } ?>><?php echo stripslashes($val['TPStatus']); ?></option>
        <?php
    }
}
?>
                                            <option value="101" <?php if ('101' == $this->searchData['StatusType']) {
    echo "selected='true'";
} ?>>Follow Ups</option>
                                            <option value="102" <?php if ('102' == $this->searchData['StatusType']) {
    echo "selected='true'";
} ?>>Iteration Required</option>
                                        </select>
                                    </div>
                                </div>
								
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <label><strong>From</strong></label>
                                        <div class="input-group ls-group-input">
                                            <input name="dateFrom" class="form-control datePickerOnly valid" id="LeadQueryFrom" placeholder="yyyy-mm-dd" value="<?php echo isset($this->searchData['dateFrom']) ? $this->searchData['dateFrom'] : ''; ?>" type="text"/>
                                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        </div>
                                    </div>
                                </div><div class="col-md-4">
                                    <div class="form-group">
                                        <label><strong>To</strong></label>
                                        <div class="input-group ls-group-input">
                                            <input name="dateTo" class="form-control datePickerOnly valid" id="LeadQueryTo" placeholder="yyyy-mm-dd" value="<?php echo isset($this->searchData['dateTo']) ? $this->searchData['dateTo'] : ''; ?>" type="text"/>
                                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group--">
                                        <label>Expired (past date)</label>
                                        <input class="icheck" type="checkbox" name="isexpired" value="1" <?php echo isset($this->searchData['isexpired']) ? "checked='checked'" : ""; ?> />
                                    </div>
                                </div>
                                
                                <div class="col-md-12" align="right">
                                    <div class="form-group form-group1 flexipadding">
                                        <button onclick="window.location.href = '<?php echo $this->baseUrl('/customer/customer-proposal-prashant'); ?>'" class="btn btn-primarygray" type="button">Reset</button>
                                        <button class="btn btn-primary" type="submit" id="filterbutton"><i class="fa fa-search"></i> Filter</button>
                                        <input type="hidden" name="page" id="page" value="1" />
                                        <input type="hidden" id="order_details" name="order" value="<?php echo $this->getData['order']; ?>" />
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

                <div class="col-md-12 no-padding">

                    <div class="panel-body leadeBorder">


                        <div class="col-md-12 no-padding">
                            <div class="col-md-6 pull-left no-padding">
                                <div class="col-md-2 no-padding" align="left">
                                    <div class="form-group col-md-4 no-padding">
                                        <label>&nbsp;</label><br/>
                                        <div id="button-SMS">
                                            <button class="btn btn-warning" type="submit"  onclick="bulkSmsTemplates();"><i class="fa fa-mail-forward"></i> Send SMS</button>
                                        </div>
                                        <div id="Inprocess-SMS" style="display:none;">
                                            <img src="<?php echo $this->baseUrl('public/assets/images/loader.gif'); ?>"> Wait...
                                        </div>
                                    </div>

                                </div>

                                <div class="col-md-2 no-padding" align="left">
                                    <div class="form-group">
                                        <label>&nbsp;</label> 
                                        <div >
                                            <button name="addtoarchive" value="" class="btn btn-primary" onclick="changeStatusBulk();"><i class="fa fa-archive"></i> Add To Archive</button>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="col-md-3 pull-right no-padding">
                                <div class="col-md-9 no-padding">
                                    <div class="form-group">
                                        <label>Email Template</label>
                                        <select id="template" name="template" class="demo-default select-country" placeholder="Select" >
                                            <option value="">Select</option>
<?php
$arrEmailTemplates = $this->arrEmailTemplates;
if (!empty($arrEmailTemplates)) {
    foreach ($arrEmailTemplates as $tempValues) {
        ?>
                                                    <option value="<?php echo trim($tempValues['Id']); ?>"><?php echo trim($tempValues['TemplateName']); ?></option>
    <?php }
} ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-3 no-padding" align="right">
                                    <div class="form-group">
                                        <label>&nbsp;</label><br/>
                                        <div id="email-Inprocess">
                                            <button class="btn btn-warning" type="submit"  onclick="bulkEmail();"><i class="fa fa-mail-forward"></i> Email</button>
                                        </div>
                                        <div id="Inprocess" style="display:none;">
                                            <img src="<?php echo $this->baseUrl('public/assets/images/loader.gif'); ?>"> Wait...
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>



                        <div class="table-responsivenew">
                            <table class="table table-bordered no-margin">
                                <thead>                                           
                                    <tr class="alert alert-graylight">
                                        <th class="small" style="vertical-align:top;">
                                            <input type="checkbox" class="icheck" name="chkAll" id="chkAll" value="" title="Check / Uncheck All" />
                                        </th>
                                        <th class="small" style="vertical-align:top;">
                                            Query Date/Age
                                        </th>
                                        <th class="small" style="vertical-align:top;">
<?php if (isset($this->getData['order']) && !empty($this->getData['order']) && $this->getData['order'] == 'proposalId_1') { ?>
                                                <a onclick="return sortByOrder('proposalId_0');" style="cursor:pointer;">Proposal ID<i class="fa fa-arrow-up"></i></a>
<?php } else { ?>
                                                <a onclick="return sortByOrder('proposalId_1');" style="cursor:pointer;">Proposal ID<i class="fa fa-arrow-down"></i></a>
<?php } ?>
                                        </th>
                                        <th class="small" style="vertical-align:top;">
                                            <?php if (isset($this->getData['order']) && !empty($this->getData['order']) && $this->getData['order'] == 'travelDate_1') { ?>
                                                <a onclick="return sortByOrder('travelDate_0');" style="cursor:pointer;">Travel Date<i class="fa fa-arrow-up"></i></a>
                                            <?php } else { ?>
                                                <a onclick="return sortByOrder('travelDate_1');" style="cursor:pointer;">Travel Date<i class="fa fa-arrow-down"></i></a>
                                            <?php } ?>
                                        </th>
                                        <th class="small" style="vertical-align:top;">Type</th>
                                        <th class="small" style="vertical-align:top;">Customer Name</th>
                                        <th class="small" style="vertical-align:top;">No. of Pax</th>
                                        <th class="small" style="vertical-align:top;">Destinations</th>
                                        <th class="small" style="vertical-align:top;">Offer Price</th>
                                        <th class="small" style="vertical-align:top;">Source</th>
                                        <th class="small" style="vertical-align:top;">
<?php if (isset($this->getData['order']) && !empty($this->getData['order']) && $this->getData['order'] == 'stage_1') { ?>
                                                <a onclick="return sortByOrder('stage_0');" style="cursor:pointer;"> Stage<i class="fa fa-arrow-up"></i></a>
                                            <?php } else { ?>
                                                <a onclick="return sortByOrder('stage_1');" style="cursor:pointer;"> Stage<i class="fa fa-arrow-down"></i></a>
                                            <?php } ?>
                                        </th>
                                        <th class="small" style="vertical-align:top;">
                                            <?php if (isset($this->getData['order']) && !empty($this->getData['order']) && $this->getData['order'] == 'owner_1') { ?>
                                                <a onclick="return sortByOrder('owner_0');" style="cursor:pointer;"> Owner<i class="fa fa-arrow-up"></i></a>
<?php } else { ?>
                                                <a onclick="return sortByOrder('owner_1');" style="cursor:pointer;"> Owner<i class="fa fa-arrow-down"></i></a>
<?php } ?>
                                        </th>
                                        <th class="small" style="vertical-align:top;">

                                    <?php if (isset($this->getData['order']) && !empty($this->getData['order']) && $this->getData['order'] == 'lastUpdate_1') { ?>
                                                <a onclick="return sortByOrder('lastUpdate_0');" style="cursor:pointer;">Last Updated<i class="fa fa-arrow-up"></i></a>
                                    <?php } else { ?>
                                                <a onclick="return sortByOrder('lastUpdate_1');" style="cursor:pointer;">Last Updated<i class="fa fa-arrow-down"></i></a>
                                    <?php } ?>
                                        </th>

                                        <th class="small" style="vertical-align:top;">Chat</th>
                                        <th class="small" style="vertical-align:top;">Action</th>
                                    </tr>
                                </thead>
                                <tbody>

                                    <?php
                                    if (!empty($LeadListArr) ) {
                                        $objTravelModel = new Travel_Model_CRM_CustomerTravelPlan();
                                        $h = 0;
                                        $objPkgBooking = new Travel_Model_TblPackageBooking();
                                        
                                        $allStatusDisplayArrayNew = $objTravelModel->GetAllProposalStatusModuleCompArrayNew();
//                                        echo "<pre>";print_r($allStatusDisplayArrayNew);die;
                                        
                                        
                                        foreach ($LeadListArr as $leadlist) { //echo '<pre>'; print_r($leadlist);exit;
                                            //$chatDetails=$objTravelModel->GetCustomerChatHistoryDetailsById($leadlist['TPSysId']);
                                            //$arrAmountPaid = $objPkgBooking->getAmountPaidForProposalByTPSysId($leadlist['TPSysId']);
                                            $TotalAmountPaid = !empty($arrAmountPaid['TotalAmountPaid']) ? $arrAmountPaid['TotalAmountPaid'] : 0;

                                            //$getMasterTPSysId = $customhelper->GeMasterTPSysId($leadlist['MasterTPSysId']);

                                            $fromDate = $leadlist['MasterCreateDate']->format('Y-m-d');
                                            //echo $leadlist['ActiveDate']->format('Y-m-d')
                                            $fromDateTime = time() - strtotime($leadlist['MasterCreateDate']->format('Y-m-d H:i:s'));
                                            $toDate = date('Y-m-d', time());
                                            if ($fromDateTime / 3600 < 24) {
                                                $fromDateTime = abs($fromDateTime / 60);
                                                $differenceIndays = Zend_Controller_Action_HelperBroker::getStaticHelper('DateFormat')->convertToHoursMins($fromDateTime);
                                            } else {
                                                $differenceIndays = Zend_Controller_Action_HelperBroker::getStaticHelper('DateFormat')->calculateNoOfDays($fromDate, $toDate);
                                                $differenceIndays = $differenceIndays . " Days";
                                            }

                                            $childinPAckage = 0;
                                            $adultinPAckage = 0;
                                            $infantinPAckage = 0;
                                            $returndate = '';
                                            $departuredate = '';
                                            $totalmember = '';
                                            $paxTOtalArr = json_decode($leadlist['RoomInfoJson']);
                                            if (!empty($paxTOtalArr) ) {
                                                foreach ($paxTOtalArr as $PaxTotal) {
                                                    $adultinPAckage += @$PaxTotal->Adult;
                                                    $childinPAckage += @$PaxTotal->Child;
                                                    $infantinPAckage += @$PaxTotal->Infant;
                                                    $departuredate = @$PaxTotal->departuredate;
                                                    $returndate = trim(@$PaxTotal->returndate);
                                                    $totalmember = trim(@$PaxTotal->totalmember);
                                                }
                                            }
//                                       $proposalID = 'D/'.($leadlist['UpdateDate']->format('y')).'/'.$leadlist['TPSysId']."/V".$leadlist['VersionId'];
                                            $proposalID = ($leadlist['PlanBookingId']) . '/' . $leadlist['TPSysId'] . "/V" . $leadlist['VersionId'];
                                            $isPkgReadymade = $leadlist['Readymade'];
                                            $pkgId = $leadlist['TPSysId'];

                                            if ($isPkgReadymade == 0) {
                                                $viewPackageLink = $this->baseUrl('/package/view-byo-pkg/id/' . base64_encode($leadlist['TPSysId']));
                                                $modifyPackageLink = $this->baseUrl('/package/add-customer-package/id/' . $leadlist['TPSysId']);
                                                $modifyPkgOnclick = "modifyByoPackageProposal('$pkgId')";
                                            } else {
                                                $modifyPackageLink = '#';
                                                $modifyPkgOnclick = "modifyReadymadePackageProposal('$pkgId')";
                                                $secureCode = Zend_Controller_Action_HelperBroker::getStaticHelper('SecureCode')->secureCode(base64_encode($leadlist['TPSysId']), 1);
                                                $viewPackageLink = $this->baseUrl('/publicpackage/view-customer-final-package/code/' . $secureCode . '/id/' . base64_encode($leadlist['TPSysId']));
                                            }

                                           // $chatDetails = $objTravelModel->GetCustomerChatHistoryDetailsById($leadlist['TPSysId']);
                                            ?>
                                            <tr>
                                                <td class="small"><input type="checkbox" class="icheck checkall" CustomerSysId="<?php echo trim($leadlist['CustomerSysId']); ?>" id="chk_<?php echo $leadlist['TPSysId']; ?>" name="" value="<?php echo trim($leadlist['TPSysId']); ?>"/></td>
                                                <td class="small"><?php echo!empty($leadlist['MasterCreateDate']) ? $leadlist['MasterCreateDate']->format('d/m/y') : 'NA';
                                            echo $differenceIndays ? "<br/>-<br/> " . $differenceIndays : ''; ?></td>
                                                <td class="small"><a target="_blank" href="<?php echo $this->baseUrl('/leaddetail/proposal/id/' . base64_encode($leadlist['MasterTPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>"><?php echo $proposalID . "<br/>Q:" . $leadlist['MasterTPSysId']; ?></a></td>
                                                <td class="small"><?php //echo "ggggggg".$leadlist['RefSysId']."<br/>"; 
                                            echo $departuredate;
                                            echo trim($returndate) ? " - " . $returndate : '';
                                            ?></td>
                                                <td class="small"><?php
                                                    if ($leadlist['PlanType'] == 5) {
                                                        if ($leadlist['Readymade'] == 1 && $leadlist['IsPriceShared'] == 1 && $leadlist['PackSpecType'] != 4) {
                                                            echo 'Readymade Package (WP)';
                                                        } else if ($leadlist['Readymade'] == 1 && $leadlist['IsPriceShared'] == 0) {
                                                            echo 'Readymade Package (WOP)';
                                                        } else if ($leadlist['Readymade'] == 1 && $leadlist['PackSpecType'] == 4) {
                                                            echo 'Readymade Quick Package';
                                                        } else {
                                                            echo 'Dynamic Package';
                                                        }
                                                    } else {
                                                        echo trim(stripslashes($getPlanTypeArray[$leadlist['PlanType']]));
                                                    }
                                                    if (!in_array(ISNOTDISPALYSN, @$_SESSION['sessionLogin_user']['getAgencyContentPermission']) && $leadlist['IsGTXNetwork'] == 0) {
                                                        // echo "prashant"; exit;
                                                        if (trim($leadlist['SupplierFirstName']) != '') {
//                                                            $helperInstance = $this->getHelper("proposals");
//                                                            $suppliercount = $helperInstance->suppliers($leadlist['TPSysId'], '', '');
//                                                            $totalsupplier = $suppliercount ? count($suppliercount) : 0;
//                                                            $suppIds = array();
//                                                            if (count($suppliercount) > 0) {
//                                                                foreach ($suppliercount as $k => $v) {
//                                                                    $suppIds[] = $v['SupplierSysId'];
//                                                                }
//                                                            }
                                                            $suppIds = array($leadlist['SupplierSysId']);
                                                            $allSuppIds = implode(",", $suppIds);
                                                            ?>
                                                            <a href="<?php echo $this->baseUrl('/leaddetail/lead-supplier-detail/id/' . base64_encode($leadlist['TPSysId']) . '/sid/' . base64_encode($allSuppIds)); ?>" data-target="#viewquotesupplier" data-toggle="modal" ><?php echo "Supplier";?></a>
                                                        <?php }
                                                    } ?>
                                                </td>
                                                <td class="small">
                                                    <?php echo (!empty($leadlist['FirstName'])) ? "<a href='" . $this->baseUrl('/customer/customer-profile-desc/id/' . base64_encode($leadlist['CustomerSysId'])) . "' target='_blank'>" . ucfirst(trim($leadlist['FirstName']) . '&nbsp;' . trim($leadlist['LastName'])) . "</a>" : 'NA' ?><br/>
                                                    <?php echo trim($leadlist['Contacts']) ? trim($leadlist['Contacts']) . "" : ''; ?><br/>
                                                    <?php echo trim($leadlist['EmailId']) ? trim($leadlist['EmailId']) . "" : ''; ?>
                                                </td>

                                                <td class="small">
                                                    <?php
                                                    if ($leadlist['PlanType'] == 7) {
                                                        echo count($paxTOtalArr) . '&nbsp;Forex Type';
                                                    } else if ($leadlist['PlanType'] == 4) {
                                                        echo!empty($totalmember) ? $totalmember . '&nbsp;Member(s)' : '';
                                                    } else {
                                                        if ($adultinPAckage > 0) {
                                                            echo!empty($adultinPAckage) ? $adultinPAckage . '&nbsp;Adult(s)' : '';
                                                            echo!empty($childinPAckage) ? ', ' . $childinPAckage . '&nbsp;Kid ' : '';
                                                            echo!empty($infantinPAckage) ? ', ' . $infantinPAckage . '&nbsp;Infant ' : '';
                                                        } else {
                                                            echo "NA";
                                                        }
                                                    }
                                                    //$PkgSellValidTill = (array)$leadlist['PkgSellValidTill'];
                                                    // $PackageToDate = strtotime(date('Y-m-d',strtotime($PkgSellValidTill['date'])));
                                                    //print_r($departuredate);
                                                    $departuredate_exp = explode("/", $departuredate);
                                                    $newStartDate = @$departuredate_exp[2] . "-" . @$departuredate_exp[1] . "-" . @$departuredate_exp[0];
                                                    $proposalToDate = strtotime($newStartDate);
                                                    $curdate = strtotime(date('Y-m-d'));
                                                    $planName = strtolower($getPlanTypeArray[$leadlist['PlanType']]);
                                                    if ($curdate > $proposalToDate) {
                                                       $allStatusDisplayArrayById = $customhelper->getDisplayStatusByStatusId($leadlist['StatusType'], 1, $planName, 2, 15,$allStatusDisplayArrayNew);
                                                    } else {
                                                       $allStatusDisplayArrayById = $customhelper->getDisplayStatusByStatusId($leadlist['StatusType'], '', $planName, 2, 15,$allStatusDisplayArrayNew);
                                                    }
                                                    // start : code added by Ranvir singh on 27 Sep 2017
                                                    $expired = "";
                                                    $psddate = $leadlist['StartDate']->format('Y-m-d');
                                                    if (($curdate) > strtotime($psddate)) {
                                                        $expired = " - Exp.";
                                                    }
                                                    // end : code added by Ranvir singh on 27 Sep 2017
													
                                                    ?>
                                                </td>
                                                <td class="small"><?php echo (!empty($leadlist['Cities']) && trim($leadlist['Cities']) != '') ? stripslashes($leadlist['Cities']) : stripslashes($leadlist['DestinationPlaces']); ?></td>
                                                <td class="small"><?php echo (!empty($leadlist['NetPrice']) && trim($leadlist['NetPrice']) != '') ? $leadlist['Symbol'] . ' ' . round($leadlist['NetPrice'], 2) : 0; ?></td>
                                                <td class="small"><?php echo (!empty($leadlist['LeadSource']) && trim($leadlist['LeadSource']) != '') ? stripslashes($leadlist['LeadSource']) : 'NA'; ?></td>
                                                <td class="small proposalStatus" id="status_<?php echo $h; ?>">
                                                <span class="queryStatus_<?php echo $leadlist['TPSysId']; ?>">
                                                    <?php
                                                    echo $statustypename = (isset($leadlist['StatusType']) && !empty($leadlist['StatusType']) && isset($statusArray[$leadlist['StatusType']]['TPStatus'])) ? $statusArray[$leadlist['StatusType']]['TPStatus'] : 'NA';
													?>
                                                    </span>
                                                    <?php
                                                    $plantype_forlink = strtolower(trim(stripslashes($getPlanTypeArray[$leadlist['PlanType']])));
                                                    $openAddModalToDo = "actionChangeProposalStatusAddIteration('" . base64_encode($leadlist['TPSysId']) . "',$h,'{$plantype_forlink}_" . $leadlist['TPSysId'] . "'," . $leadlist['MasterTPSysId'] . "," . $leadlist['CustomerSysId'] . ",'" . base64_encode(27) . "','$proposalID', '" . trim($leadlist['CustomerSysId']) . "','" . trim($leadlist['ownerName']) . "','" . $leadlist['AgentSysId'] . "',this)";
                                                    if (!in_array($statustypename, $statustypenameForExpiredArr)) {
                                                        echo ($expired) ? '<span class="red"> ' . $expired . "</span>" : '';
                                                    }
													
                                                    if ($leadlist['hasIteration']) {
                                                        ?>
                                                        <br/><a func="<?php echo $openAddModalToDo ?>" href="javascript:void(0);" onclick="getItineraryRequired('<?php echo $leadlist['CustomerSysId']; ?>', '<?php echo $leadlist['TPSysId']; ?>', $(this).attr('func'));" title="View iteration required list" style="color:#0e931d;">
                                                            Iterations
                                                        </a>
                                                        <?php
                                                    } else {
                                                        ?>
                                                        <br/> <a click-src="itinerary" href="javascript:void(0);" title="Add Iteration" class="" style="color: #F22C0C"
                                                                 onclick="actionChangeProposalStatusAddIteration('<?php echo base64_encode($leadlist['TPSysId']); ?>',<?php echo $h; ?>, 'package_<?php echo $leadlist['TPSysId']; ?>',<?php echo $leadlist['MasterTPSysId']; ?>,<?php echo $leadlist['CustomerSysId']; ?>, '<?php echo base64_encode(27); ?>',
                                                                                 '<?php echo $proposalID ?>', '<?php echo trim($leadlist['CustomerSysId']); ?>', '<?php echo trim($leadlist['ownerName']); ?>', '<?php echo $leadlist['AgentSysId']; ?>', this);"> Iteration
                                                        </a>
            <?php
        }
        echo ' | ';
//                                                    if(!empty($leadlist['ToDoSysId']) && ($leadlist['todoType'] == '0') || ($leadlist['todoType'] == '1') ){
        if ($leadlist['hasFollowUp']) {
            ?>
                                                        <a func="<?php echo $openAddModalToDo ?>" href="javascript:void(0);" onclick="getFollowUp('<?php echo $leadlist['CustomerSysId']; ?>', '<?php echo $leadlist['MasterTPSysId']; ?>', $(this).attr('func'));"  title="View follow up list" style="color:#0e931d;">
                                                            Follow Ups</a>
                                                    <?php
                                                    } else {
                                                        ?>
                                                        <a click-src="addtodo" href="javascript:void(0);" title="Add Follow Up" class="" style="color: #F22C0C"
                                                           onclick="actionChangeProposalStatusAddIteration('<?php echo base64_encode($leadlist['TPSysId']); ?>',<?php echo $h; ?>, 'package_<?php echo $leadlist['TPSysId']; ?>',<?php echo $leadlist['MasterTPSysId']; ?>,<?php echo $leadlist['CustomerSysId']; ?>, '<?php echo base64_encode(27); ?>',
                                                                           '<?php echo $proposalID ?>', '<?php echo trim($leadlist['CustomerSysId']); ?>', '<?php echo trim($leadlist['ownerName']); ?>', '<?php echo $leadlist['AgentSysId']; ?>', this);"> Follow Up
                                                        </a>
                                                        <?php
                                                    }
                                                    ?>
                                                        |
                                                        <a click-src="addtodo" href="javascript:void(0);" title="Update Status" class="" style="color: #000"
                                                                    onclick="actionChangeQueryStatus( '<?php echo base64_encode($leadlist['TPSysId']); ?>','<?php echo $leadlist['StatusType']; ?>','<?php echo $leadlist['LeadQuality']; ?>','2');"> Update
                                                        </a>
                                                        <br>
                                                        <a data-target="#myModalViewTouchPoints" title='View Query History' href="<?php echo $this->baseUrl('/leaddetail/view-touch-points/cid/'.base64_encode($leadlist['CustomerSysId']).'/tpid/'.base64_encode($leadlist['TPSysId'])); ?>"  data-toggle="modal">Touch Points</a>
                                                            
                                                         <span class="leadQualityDetails_<?php echo $leadlist['TPSysId']; ?>">
                                                        <?php if(isset($leadlist['LeadQuality']) && $leadlist['LeadQuality'] == 1){?>
                                                        <span style="background-color:#19ce37; color:#fff;padding: 0px 8px;"><?php echo $AllLeadQualityStatusName[$leadlist['LeadQuality']]; ?></span>
                                                        <?php }elseif(isset($leadlist['LeadQuality']) && $leadlist['LeadQuality'] == 2){ ?>
                                                        <span style="background-color:#efdd0a;color:#000;padding: 0px 8px;"><?php echo $AllLeadQualityStatusName[$leadlist['LeadQuality']]; ?></span>
                                                        <?php }elseif(isset($leadlist['LeadQuality']) && $leadlist['LeadQuality'] == 3){ ?>
                                                        <span style="background-color:#65bcfb;color:#fff;padding: 0px 8px;"><?php echo $AllLeadQualityStatusName[$leadlist['LeadQuality']]; ?></span>
                                                        <?php } ?>
                                                        </span>
                                                </td>
                                                <td class="small">
                                                    <?php echo $leadlist['ownerName']; ?><br/>
                                                    <?php echo ($leadlist['Designation'] != "") ? ("(" . $leadlist['Designation'] . ")") : ''; ?>
                                                </td>
                                                <td class="small"><?php echo (isset($leadlist['UpdateDate']) && !empty($leadlist['UpdateDate'])) ? $leadlist['UpdateDate']->format('d/m/Y') : 'NA'; ?>
                                                <br />
                                                <?php if (isset($leadlist['RefSysId']) && $leadlist['RefSysId'] != "") { ?>
                                                <a href='javascript://' onclick="getSMSStatus('<?php echo $leadlist['RefSysId'];?>','<?php echo $leadlist['TPSysId'];?>')"><span id="<?php echo $leadlist['RefSysId'];?>"><?php if($leadlist['RefSysStatus'] != '') { echo $leadlist['RefSysStatus']; } else { echo "Get Email Status"; } ?></span></a>
                                                <?php } ?>
                                                
                                                </td>
                                                <td class="small" style="white-space:nowrap; text-align:center;" align="center">
                                                    <?php if ($leadlist['TotalChat'] > 0) { ?>
                                                        <a href="<?php echo $this->baseUrl('/customer/customer-chat-history/id/' . base64_encode($leadlist['TPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>" data-original-title="View" data-placement="top"  data-target="#viewquotesupplier" data-toggle="modal" title=""><i class="fa fa-comments green"></i></a>
                                                    <?php } else { ?>
                                                        <a href="<?php echo $this->baseUrl('/customer/customer-chat-history/id/' . base64_encode($leadlist['TPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>" data-original-title="View" data-placement="top"  data-target="#viewquotesupplier" data-toggle="modal" title=""><i class="fa fa-comments red"></i></a>
                                                    <?php } ?>
                                                </td>
                                                <td class="small"   style="white-space:nowrap; text-align:center;display:none;" align="center">
                                                    <?php if ($leadlist['IsAgent'] == 0) { ?>
                                                        <a href="<?php echo $this->baseUrl('/customer/customer-chat-history/id/' . base64_encode($leadlist['TPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>" data-original-title="View" data-placement="top"  data-target="#viewquotesupplier" data-toggle="modal" title=""><i class="fa fa-comments red"></i></a>
        <?php } else { ?>
                                                        <a href="<?php echo $this->baseUrl('/customer/customer-chat-history/id/' . base64_encode($leadlist['TPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>" data-original-title="View" data-placement="top"  data-target="#viewquotesupplier" data-toggle="modal" title=""><i class="fa fa-comments green"></i></a>
                                                    <?php } ?>
                                                </td>
                                                <td class="small" style="white-space:nowrap;">
        <?php
        //echo $leadlist['CustomerSysId'];
        //print_r($getMasterTPSysId);
        //echo $getMasterTPSysId[0]['MasterTPSysId'];
        ?>
                                                    <a style="margin:0px !important; padding:0px;" href="<?php echo $this->baseUrl('/leaddetail/proposal/id/' . base64_encode($leadlist['MasterTPSysId']) . '/cid/' . base64_encode($leadlist['CustomerSysId'])); ?>" target="_blank" title="View Query/Proposal"><i class="tooltipLink fa fa-eye btn btn-success btn-xs"></i> </a> 
                                                    <div class="clear"></div>
                                                    <a style="margin:0px !important; padding:0;" data-target="#myModalSendSMSToDoCustomer"  class="btn btn-xs tooltipLink" title='Send Sms' href="<?php echo $this->baseUrl('/leaddetail/view-sms-template-to-customer/cid/' . base64_encode($leadlist['CustomerSysId']) . '/tpid/' . base64_encode($leadlist['TPSysId'])); ?>"  data-toggle="modal"><i class="tooltipLink fa fa-comment-o btn btn-primary btn-xs"></i></a>                                                
                                                  <div class="clear"></div>
                                                    <a style="display:none;" data-target="#myModalSendEMAILToDoCustomer"  class="btn btn-xs tooltipLink" title='Send Email' href="<?php echo $this->baseUrl('/leaddetail/view-email-template-to-customer/cid/' . base64_encode($leadlist['CustomerSysId']) . '/tpid/' . base64_encode($leadlist['TPSysId'])); ?>"  data-toggle="modal"><i class="tooltipLink fa fa-envelope btn btn-primary btn-xs"></i></a> 
                                                    <div class="clear"></div>                                               
                                            <?php
											$uid=$leadlist['CustomerSysId'].':'.$leadlist['TPSysId'].':'.$leadlist['MasterTPSysId'];
											 $uid=$customhelper->getEnc($uid);
                                            echo $this->partial('leaddetail/leadstatusdropdownpartial.phtml', array('proposalDetails' => $leadlist, 'allStatusDisplayArrayById' => $allStatusDisplayArrayById, 'loopId' => $h, 'uid' => $uid));
											
                                            ?>

                                                </td>
                                            </tr>
                                <?php
                                $h++;
                            }
                        } else {
                            ?>
                                        <tr class="alert alert-danger"><td colspan="15" style="text-align:center;"><strong>No record found</strong></td></tr>
<?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="col-md-12 text-right no-padding">
    <?php
    if (!empty($this->paginator) ) {
        $IsSubmitForm = (isset($this->searchData) && count($this->searchData) > 0) ? true : false;
        ?>
    <?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination-form.phtml', array('IsSubmitForm' => $IsSubmitForm, 'FormName' => 'myProposalFilterForm')); ?>
<?php } ?> 
                    </div>
                </div>
            </div>
            <!-- Main Content Element  End-->
        </div>
    </div>

<?php echo $this->render('copyrightfooter.phtml'); ?>
</section>
<!-- popup modal for view touch points or history of query -->
	<div class="modal fade in" id="myModalViewTouchPoints" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
				<div class="center">
                        <img class="loaderimg"  id="loaderimg" src="<?php echo $this->baseUrl('/public/tinymce/skins/lightgray/img/loader.gif'); ?>"/>
                </div>
            </div>
        </div>
    </div>
<!-- end of popup modal for view touch points or history of query -->

<!--Page main section end -->
<div class="modal fade" id="viewquotesupplier" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
        </div>
    </div>
</div>
<!-- popup modal for send sms to customer -->
<div class="modal fade in" id="myModalSendSMSToDoCustomer" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="center">
                <img class="loaderimg"  id="loaderimg" src="<?php echo $this->baseUrl('/public/tinymce/skins/lightgray/img/loader.gif'); ?>"/>
            </div>
        </div>
    </div>
</div>
<!-- end of popup modal for send sms to customer -->
<!-- popup modal for send email to customer -->
<div class="modal fade in" id="myModalSendEMAILToDoCustomer" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="center">
                <img class="loaderimg"  id="loaderimg" src="<?php echo $this->baseUrl('/public/tinymce/skins/lightgray/img/loader.gif'); ?>"/>
            </div>
        </div>
    </div>
</div>
<!-- end of popup modal for send sms to customer -->


<!-- start : added by Ranvir Singh on 27 09 2017 for itinerary -->
<div class="modal fade in" id="myModalAddToDoCustomer" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Add ToDo/Follow Up </h4>
            </div>
            <div class="alert alert-success" id="succmsg" style="display:none;">
                <strong>Success!</strong>Customer has been Added.
            </div>
            <div class="modal-body">
                <div class="col-md-12">
                    <div class="form-group" style="min-height:inherit; margin-bottom:0;">
                        <label><input type="radio" name="followup" value="1" class="followup" readonly=""/> Follow Up</label> &nbsp;&nbsp;
                        <label><input type="radio" name="followup" value="0" class="followup" readonly="" /> To Do</label> &nbsp;&nbsp;
                        <label><input type="radio" name="followup" value="2" class="followup" checked="checked" /> Iteration Required</label>
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>Title</label>
                        <input class="form-control whbg" name="subject" id="subject" type="text">                       
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>Due Date</label>
                        <input class="form-control whbg leadtodostartdate" name="todostartdate" id="todostartdate" type="text">                       
                    </div>
                </div>

                <div class="col-md-6" style="display:none;">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>End Date</label>
                        <input class="form-control whbg leadtodoenddate" name="todoenddate" id="todoenddate" type="text">                       
                    </div>
                </div>

                <div class="col-md-6" style="display:none;">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>Select Customer</label>
                        <input class="form-control ui-autocomplete-input" autocomplete="off" name="contact" id="contact">       
                        <input type="hidden" name="custsysID" id="custsysID" value="" />
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>Assigned To</label>
                        <input class="form-control whbg" name="assignedto" id="assignedto" value="" type="text" />   
                        <input type="hidden" name="assignedtoId" id="assignedtoId" value="" />                    
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group" style="min-height:inherit; ">
                        <label>To Do Reminder</label>
                        <input class="form-control whbg number" name="todoreminder" id="todoreminder" type="text" onkeyup="return kp_numeric(event);"> 
                        <span style="font-size:12px"><h7>In Minutes</h7></span>  
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="form-group cityDiv" style="min-height:inherit;">
                        <label>Details</label>
                        <textarea class="form-control whbg" name="details" id="details"  type="text" rows="3" cols="7"> </textarea>                   
                    </div>
                </div>
                <div class="col-md-10">
                    <div class="form-group cityDiv" style="min-height:inherit; margin-bottom:0;">
                        <label><input type="checkbox" name="markasdone" value="0" id="markasdone" />      
                            Mark as done</label>

                    </div>
                </div>

                <input id="_proposal_id_hidden" type="hidden" value="" />
                <input id="_to_pop_type_id_hidden" type="hidden" value="addtodo" />
                <input id="_to_loopid_hidden" type="hidden" value="" />
                <input id="_to_leadtypeid_hidden" type="hidden" value="" />
                <input id="_to_MasterTPSysId_hidden" type="hidden" value="" />
                <input id="_to_CustomerSysId_hidden" type="hidden" value="" />
                <input id="_to_ProposalStatusId_hidden" type="hidden" value="" />
                <input id="_to_proposalIDTitle_hidden" type="hidden" value="" />
                <input id="_to_CustomerSysId_hidden" type="hidden" value="" />
                <input id="_to_ownerName_hidden" type="hidden" value="" />
                <input id="_to_AgentSysId_hidden" type="hidden" value="" />

                <div class="clear"></div>

            </div>

            <div class="modal-footer">
                <a href="javascript:void(0);"><button type="button" class="btn btn-warning pull-right submittodo" id="SubmitToDoItinerary" >Submit</button></a>
                <button type="button" class="btn btn-primarygray pull-left" data-dismiss="modal">Cancel</button>
            </div>

        </div>
    </div>
</div>
<!-- start : added by Ranvir Singh on 27 09 2017 for itinerary -->


<div class="modal fade in" id="myModalAddQueryStatusPop" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <form class="ls_form" role="form" action="/leaddetail/saveupdatequerystatusquality" method="post" autocomplete="off" id="saveupdatequerystatusquality" name="">
            <input type="hidden" name="pages" id="pages" value="/customer/customer-proposal">
            <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Update Proposal Status and Lead Quality </h4>
            </div>
            <div class="alert alert-success" id="succmsg" style="display:none;">
                <strong>Success!</strong>Customer has been Added.
            </div>
            <div class="modal-body">
                <div class="col-md-6"> 
                    <div class="form-group" style="min-height:inherit; ">
                        <!--<label class="stststsst"></label>-->
                        <select id="QueryStatus" name="sid" class="form-control QueryStatus" placeholder="Select" >
                            
                        </select>  
                    </div>
                </div>
                <div class="col-md-6"> 
                    <div class="form-group" style="min-height:inherit; ">
                        <select id="LeadQuality" name="LeadQuality" class="form-control LeadQuality" placeholder="Select" >
                       
                        </select>
                    </div>
                </div>

                <input id="proposalId" type="hidden" name="TPSysId" value="" />
                
                <input id="QueryStatus_temp" name="sidss" type="hidden" value="" />

                <div class="clear"></div>

            </div>

            <div class="modal-footer">
                <a href="javascript:void(0);"><button type="submit" class="btn btn-warning pull-right saveaction" >Submit</button></a>
                <button type="button" class="btn btn-primarygray pull-left" data-dismiss="modal">Cancel</button>
            </div>

        </div>
            </form>
    </div>
</div>


<?php echo $this->render('common-modals/customer.phtml'); ?> 
<?php
//echo $this->render('modals.phtml');
echo $this->render('newfooter.phtml');
?>

<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/jquery.validate.min.js'); ?>"></script>

<script src="<?php echo $this->baseUrl('public/js/customer/customer.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/customer.js'); ?>"></script>

<script type="text/javascript">
$('#myModalViewTouchPoints').on('hidden.bs.modal', function () {
        $(this).removeData('bs.modal');
});
function sortByOrder(orderInfo){
	$("#order_details").val(orderInfo);
	$("#filterbutton").trigger('click');
	//$(".ls_form").submit();
}
                            $('#chkAll').on('ifChecked', function (event) {
                                $(".checkall").iCheck('check');
                            });


                            $('#chkAll').on('ifUnchecked', function (event) {
                                $(".checkall").iCheck('uncheck');
                            });

                            function getSMSStatus(sId,TPId){
                                $.ajax({
                                    url: '/gtxwebservices/index/get-email-status',
                                    data: {TPSysIds: TPId, templateId: sId},
                                    type: 'POST',
                                    dataType: 'json',
                                    beforeSend: function () { //alert("HI")
                                        $("#"+sId).html('In Progress....');
                                        

                                    },
                                    success: function (response) {
                                        
                                        if (response.success) {
                                            $("#"+sId).html(response.msg);
                                            $("#"+sId).show();
                                        } else {
                                            $("#"+sId).show();
                                        }
                                    },
                                    error: function () {
                                        alert("fail : Please try after some time");
                                        $("#"+sId).hide();
                                    }
                                });
                            }

                            function bulkEmail() {

                                var checkedChk = $('.checkall').filter(':checked').length;
                                var templateId = $('#template').val();
                                if (checkedChk == '0') {
                                    $('#rvModalAlert').modal('show').find('.modal-body p').html('Please select at least one record for action.');
                                    return false;

                                }
                                if (templateId == '') {
                                    $('#rvModalAlert').modal('show').find('.modal-body p').html('Please select template.');
                                    return false;

                                }


                                var TPSysIds = $('input:checkbox:checked.checkall').map(function () {
                                    return this.value;
                                }).get();

                                $.ajax({
                                    url: '/customer/send-bulk-email-to-customer',
                                    data: {TPSysIds: TPSysIds, templateId: templateId},
                                    type: 'POST',
                                    dataType: 'json',
                                    beforeSend: function () { //alert("HI")
                                        $("#email-Inprocess").hide();
                                        $("#Inprocess").show();

                                    },
                                    success: function (response) {
                                        if (response.success) {
                                            alert(response.msg);
                                            $("#Inprocess").hide();
                                            $("#email-Inprocess").show();
                                        } else {
                                            alert(response.msg);
                                            $("#Inprocess").hide();
                                            $("#email-Inprocess").show();
                                        }
                                    },
                                    error: function () {
                                        alert("fail : Please try after some time");
                                        $("#Inprocess").hide();
                                        $("#email-Inprocess").show();
                                    }
                                });




                            }



                            function bulkSmsTemplates() {

                                var checkedChk = $('.checkall').filter(':checked').length;
                                var templateId = $('#template').val();
                                if (checkedChk == '0') {
                                    $('#rvModalAlert').modal('show').find('.modal-body p').html('Please select at least one record for action.');
                                    return false;
                                }

                                $.ajax({
                                    url: '/customer/bulk-sms-templates',
                                    data: {},
                                    type: 'POST',
                                    dataType: 'html',
                                    beforeSend: function () { //alert("HI")
                                        $("#button-SMS").hide();
                                        $("#Inprocess-SMS").show();
                                    },
                                    success: function (response) {
                                        $("#bulk-sms-modal").modal('show');
                                        $("#Inprocess-SMS").hide();
                                        $("#button-SMS").show();
                                        $("#bulk-sms-templates").html(response);
                                    },
                                    error: function () {
                                        alert("fail : Please try after some time");
                                        $("#Inprocess-SMS").hide();
                                        $("#button-SMS").show();
                                    }
                                });

                            }


                            function closeBulkSmsPopUp() {
                                $("#bulk-sms-modal").modal('hide');
                            }



                            function sendBulkSmsToCustomer() {
                                if ($('input[name=bulksmstemplate]:checked').length == 0) {
                                    alert('Please select at least one template to send sms');
                                    return false;
                                }

                                var TPSysIds = $('input:checkbox:checked.checkall').map(function () {
                                    return this.value;
                                }).get();


                                var CustomerSysIds = $('input:checkbox:checked.checkall').map(function () {
                                    return $(this).attr('CustomerSysId');
                                }).get();


                                var smsTemplateId = $('input[name=bulksmstemplate]:checked').val();
                                $.ajax({
                                    url: '/customer/send-bulk-sms-to-customer',
                                    data: {TPSysIds: TPSysIds, CustomerSysIds: CustomerSysIds, smsTemplateId: smsTemplateId},
                                    type: 'POST',
                                    dataType: 'json',
                                    beforeSend: function (data) {
                                        $("#SMS-Inprocess").hide();
                                        $("#SMS-Wait-Inprocess").show();
                                    },
                                    success: function (response) {
                                        if (response.success) {
                                            alert(response.msg);
                                            $("#SMS-Wait-Inprocess").hide();
                                            $("#SMS-Inprocess").show();
                                            $("#bulk-sms-modal").modal('hide');
                                        } else {
                                            alert(response.msg);
                                            $("#SMS-Wait-Inprocess").hide();
                                            $("#SMS-Inprocess").show();
                                        }
                                    },
                                    error: function () {
                                        alert("fail : Please try after some time");
                                        $("#SMS-Wait-Inprocess").hide();
                                        $("#SMS-Inprocess").show();
                                    }
                                });
                            }



                            function validateCustomerEmailTemplate(TPSysId, CustomerSysId) {
                                var TPSysId = TPSysId;
                                var CustomerSysId = CustomerSysId;
                                if ($('input[name=emailtemplate]:checked').length == 0) {
                                    alert('Please select at least one template to send email');
                                    return false;
                                }
                                var selectedRadio = $('input[name=emailtemplate]:checked').val();
                                $.ajax({
                                    url: '/leaddetail/send-email-template-to-customer',
                                    data: {'tpid': TPSysId, 'cid': CustomerSysId, 'tempid': selectedRadio},
                                    type: 'POST',
                                    async: false,
                                    dataType: 'json',
                                    beforeSend: function (data) {
                                        //$(".modalloader").show();
                                    },
                                    success: function (response) {
                                        if (response.status == 'success') {
                                            $("#succmsgEmail").show().fadeOut(10000);
                                        } else {
                                            alert("fail : Please try after some time");
                                        }
                                    },
                                    error: function () {
                                        alert("fail : Please try after some time");
                                    }
                                });
                            }
                            $('#myModalSendEMAILToDoCustomer').on('hidden.bs.modal', function () {
                                $(this).removeData('bs.modal');
                            });
                            $('#viewquotesupplier').on('hidden.bs.modal', function () {
                                $(this).removeData('bs.modal');
                            });




                            function changeStatusBulk() {

                                var checkedChk = $('.checkall').filter(':checked').length;

                                if (checkedChk === 0) {
                                    $('#rvModalAlert').modal('show').find('.modal-body p').html('Please select at least one record for action.');
                                    return false;
                                }

                                var TPSysIds = $('input:checkbox:checked.checkall').map(function () {
                                    return this.value;
                                }).get();

                                if (confirm('Are you sure, You want to change the status of the proposal(s) to Expired and Move the records to Archived List?')) {
                                    // run the ajax if at least one record is checked
                                    $.ajax({
                                        url: '/customer/change-status-proposal-bulk',
                                        data: {TPSysIds: TPSysIds},
                                        type: 'POST',
                                        dataType: 'json',
                                        beforeSend: function (data) {
                                            $(this).addClass('ranvir');
                                        },
                                        success: function (response) {
                                            if (response.success) {

                                                var TPSysIdsLength = TPSysIds.length;
                                                for (var r = 0; r < TPSysIdsLength; r++) {
                                                    $('#chk_' + TPSysIds[r]).closest('tr').css({'background-color': '#e95959'}).fadeOut('slow');
                                                }
                                                $('#rvModalAlert').modal('show').find('.modal-body p').html(response.msg);

                                            } else {
                                                $('#rvModalAlert').modal('show').find('.modal-body p').html(response.msg);
                                            }
                                        },
                                        error: function () {
                                            $('#rvModalAlert').modal('show').find('.modal-body p').html("fail : Please try after some time");
                                        }

                                    });
                                }

                            }


</script>



<script type="text/javascript">



    function updatePayment(TPSysId, netPrice, amountPaid) {
        $("#payment_type_online").iCheck('check');
        $("#fullPayment").iCheck('check');

        $(".TPSysIdForm").val(TPSysId);
        $("#pkgCost").html(netPrice);
        $("#pkgCostOnline").html(netPrice);
        $("#amountPaid").html(amountPaid);
        $("#amountPaidOnline").html(amountPaid);
        var remainingBalance = (parseInt(netPrice) - parseInt(amountPaid));
        $("#fullPayment").val(remainingBalance);
        $("#premium_val").val(remainingBalance);
        //alert(remainingBalance)
        $("#flex_pay").val(remainingBalance);
        $("#remainingBalance").html(remainingBalance);
        $(".outStandingBal").html(remainingBalance);
        $(".outStandingBalOnline").html(remainingBalance);
        $("#update-payment").modal();
    }

    function closeModal() {
        $("#update-payment").modal('hide');
    }



    $(document).ready(function () {

        $('#flex_pay').attr("disabled", true);


        $('#payment_type_online').on('ifChecked', function () {
            $("#paymentType").val(1);
            $("#payment_table_online").show();
            $("#payment_table_offline").hide();
        });
        $('#payment_type_offline').on('ifChecked', function () {
            $("#paymentType").val(2);
            var remainingBalance = parseInt(parseInt($("#fullPayment").val()) - parseInt($("#flex_pay").val()));
            $(".outStandingBal").html(remainingBalance);
            $("#premium_val").val($("#fullPayment").val());
            $("#payment_table_online").hide();
            $("#payment_table_offline").show();
        });

        $('#fullPayment').on('ifChecked', function () {

            $('#flex_pay').attr("disabled", true);
            var remainingBalance = (parseInt($("#fullPayment").val()) - parseInt($("#remainingBalance").html()));
            $("#premium_val").val($("#fullPayment").val());
            $("#flex_pay").val($("#remainingBalance").html());
            $(".outStandingBal").html(remainingBalance);
            //genrateSecureCode();

        });




        $('#flexiblePayment').on('ifChecked', function () {
            $('#flex_pay').attr("disabled", false);

            var remainingBalance = (parseInt($("#fullPayment").val()) - parseInt($("#flex_pay").val()));
            $("#premium_val").val($("#fullPayment").val());
            $(".outStandingBal").html(remainingBalance);

            //genrateSecureCode();

        });



        $('#flex_pay').on('blur keyup', function () {
            var advanceBookingPercentVal = $('#flex_pay').val();

            if (parseInt($("#flex_pay").val()) > parseInt($("#fullPayment").val())) {
                alert("Your amount of payment can not exceed " + $("#fullPayment").val());
                $("#flex_pay").val(0);
                $('#flex_pay').focus();
                return false;
            } else {
                var remainingBalance = parseInt(parseInt($("#fullPayment").val()) - parseInt($("#flex_pay").val()));
                $("#premium_val").val($("#flex_pay").val());
                $(".outStandingBal").html(remainingBalance);
            }

            //genrateSecureCode();


        });


    });


    function offlinePaymentProcess() {
//            var paymentType = $("#paymentType").val(); 
//            var TPSysId     = $("#TPSysId").val();
        var formvalue = $("#form_repayment").serialize();
        $.ajax({
            url: '/packagesearch/offline-payment-process',
            data: formvalue,
            dataType: 'json',
            type: 'POST',
            beforeSend: function () {
                $("#offline-buttons").hide();
                $("#offline-buttons-inprocess").show();
            },
            success: function (response) {
                if (response.success) {
                    if (response.pType == '1') {
                        alert(response.msg);
                        $("#offline-buttons").show();
                        $("#offline-buttons-inprocess").hide();
                        $("#update-payment").modal('hide');
                    } else {
                        $("#guid_repayment").val(response.arrResponse.guid);
                        $("#securecode_repayment").val(response.arrResponse.securecode);
                        $("#Firstname").val(response.arrResponse.Firstname);
                        $("#email").val(response.arrResponse.email);
                        $("#phone").val(response.arrResponse.phone);
                        $("#premium_val").val(response.arrResponse.amount);
                        $("#AgencyUserSysId").val(response.arrResponse.AgencyUserSysId);
                        $("#AgencySysId").val(response.arrResponse.AgencySysId);
                        $("#TrxType").val(response.arrResponse.TrxType);
                        $("#PlanType").val(response.arrResponse.PlanType);
                        $("#TPSysId").val(response.arrResponse.TPSysId);
                        $("#IsCardChrgToCustomer").val(response.arrResponse.IsCardChrgToCustomer);
                        $("#CustomerSysId").val(response.arrResponse.CustomerSysId);
                        $("#returnURL").val(response.arrResponse.returnURL);
                        $("#stringData").val(response.arrResponse.stringData);
                        $("#errorURL").val(response.arrResponse.errorURL);
                        $("#strPaymentUrl").val(response.arrResponse.strPaymentUrl);
                        $('#form_repayment').attr('action', response.arrResponse.strPaymentUrl);

                        setTimeout(function () {
                            $('#form_repayment').submit();
                        }, 2000);


                    }
                } else {
                    alert(response.msg);
                    $("#offline-buttons").show();
                    $("#offline-buttons-inprocess").hide();
                }
            }
        });
    }



</script>


<!--Modal Html start-->
<div class="modal fade" id="rvModalAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Alert!</h4>
            </div>
            <div class="modal-body">
                <p></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info btn-md" data-dismiss="modal">Ok</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="bulk-sms-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" id="bulk-sms-templates">
            <div class="modal-body">
                <div class="col-md-12 no-padding" id="payment_table_online">

                    <div class="col-md-8">
                        <table class="table table-bordered ">                                
                            <tbody>                                  
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Package Cost </label> <span style="text-align:center; font-size: 12px;">(Inc. GST)</span></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="pkgCostOnline"></span></td>
                                </tr>
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Amount Received </label></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="amountPaidOnline"></span></td>
                                </tr>
                                <tr>                                          
                                    <td><strong>OutStanding Bal.</strong><br></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span class="outStandingBalOnline"></span></td>
                                </tr>

                            </tbody>






                        </table>
                    </div>

                </div>






                <div class="clear"></div>

            </div>
            <div class="center">
                <img class="loaderimg"  id="loaderimg" src="<?php echo $this->baseUrl('/public/tinymce/skins/lightgray/img/loader.gif'); ?>"/>
            </div>
        </div>
    </div>
</div>   



<div class="modal fade" id="update-payment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog"> 
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Update Payment</h4>
            </div>
            <div class="modal-body">
                <div class="col-md-12 no-padding">
                    <div class="col-md-6">
                        <label class="radio inlinebl">
                            <input class="icheck-black" type="radio" checked="checked" name="payment_type" id="payment_type_online" value="1"> Online (Send Payment Reminder) 
                        </label>&nbsp;
                    </div>
                    <div class="col-md-6">
                        <label class="radio inlinebl">
                            <input class="icheck-black" type="radio" name="payment_type" id="payment_type_offline" value="2"> Offline 
                        </label>
                    </div>

                </div>
                <div class="clear">&nbsp;</div>


                <div class="col-md-12 no-padding" id="payment_table_online">

                    <div class="col-md-8">
                        <table class="table table-bordered ">                                
                            <tbody>                                  
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Package Cost </label> <span style="text-align:center; font-size: 12px;">(Inc. GST)</span></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="pkgCostOnline"></span></td>
                                </tr>
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Amount Received </label></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="amountPaidOnline"></span></td>
                                </tr>
                                <tr>                                          
                                    <td><strong>OutStanding Bal.</strong><br></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span class="outStandingBalOnline"></span></td>
                                </tr>

                            </tbody>






                        </table>
                    </div>

                </div>



                <div class="col-md-12 no-padding" id="payment_table_offline" style="display:none;">

                    <div class="col-md-12">
                        <table class="table table-bordered ">                                
                            <tbody>                                  
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Package Cost </label> <span style="text-align:center; font-size: 12px;">(Inc. GST)</span></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="pkgCost"></span></td>
                                </tr>
                                <tr>                                          
                                    <td><label class="radio no-margin inlinebl"> Amount Received </label></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="amountPaid"></span></td>
                                </tr>

                                <tr>                                          
                                    <td>
                                        <label class="radio no-margin inlinebl">
                                            <input type="radio" name="bookingPayment" id="fullPayment" value="" class="icheck-black" checked="" />
                                            Full Payment
                                        </label>
                                    </td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span id="remainingBalance"></span></td>
                                </tr>  

                                <tr>                                          
                                    <td>
                                        <label class="radio no-margin inlinebl">
                                            <input type="radio" name="bookingPayment" id="flexiblePayment" value="" class="icheck-black" />
                                            Flexible Payment
                                        </label>
                                    </td>
                                    <td class="pull-right" style="border:0px;">
                                        <span class="fa fa-rupee pull-left"></span>
                                        <input type="text" name="flex_pay" id="flex_pay" value="" class="form-control whbg" style="text-align:right; width: 120px">
                                    </td>
                                </tr>



                                <tr>                                          
                                    <td><strong>OutStanding Bal.</strong><br></td>
                                    <td align="right"><span class="fa fa-rupee"></span> <span class="outStandingBal"></span></td>
                                </tr>

                            </tbody>


                            <form id="form_repayment" method="post" name="form_repayment"  action="">
                                <input name="paymentType" id="paymentType" value="1" type="hidden">
                                <input name="guid" id="guid_repayment" value="" type="hidden">
                                <input name="securecode" id="securecode_repayment" value="" type="hidden">
                                <input name="Firstname" id="Firstname" value="" type="hidden">
                                <input name="email" id="email" value="" type="hidden">
                                <input name="phone" id="phone" value="" type="hidden">
                                <input id="premium_val" name="amount" value="" type="hidden">
                                <input name="AgencyUserSysId" id="AgencyUserSysId" value="" type="hidden">
                                <input name="AgencySysId" id="AgencySysId" value="" type="hidden">
                                <input name="TrxType" id="TrxType" value="" type="hidden">
                                <input name="PlanType" id="PlanType" value="" type="hidden">
                                <input name="TPSysId" id="TPSysId" class="TPSysIdForm" value="" type="hidden">
                                <input name="IsCardChrgToCustomer" id="IsCardChrgToCustomer" value="" type="hidden">
                                <input name="CustomerSysId" id="CustomerSysId" value="" type="hidden">
                                <input name="returnURL" id="returnURL" value="" type="hidden">
                                <input name="stringData" id="stringData" value="" type="hidden" >
                                <input name="errorURL" id="errorURL" value="" type="hidden">
                            </form>





                        </table>
                    </div>

                </div>

                <div class="col-md-12 no-padding">
                    <div class="col-md-4 pull-right">
                        <div class="form-group form-group1 flexipadding" id="offline-buttons">
                            <button onclick="closeModal();" class="btn btn-primarygray" type="button">Cancel</button>
                            <button class="btn btn-warning" onclick="offlinePaymentProcess();" type="submit"><i class="fa fa-search"></i> Submit</button>
                        </div>

                        <div class="form-group form-group1 flexipadding" id="offline-buttons-inprocess" style="display:none;">
                            <img src="<?php echo $this->baseUrl('public/assets/images/loader.gif'); ?>"> Please Wait...
                        </div>

                    </div>

                </div>
                <div class="clear"></div>

            </div>
        </div>
    </div>
</div>





Youez - 2016 - github.com/yon3zu
LinuXploit