File: /home/barbeatleanalyti/public_html/barisnew.beatleanalytics.com/site/backup/template/emailer.php
<?php
// Declare new object
$objEmailer = object;
// Assing object
$objEmailer = $objDB->objController;
// Assign all variable's value
$pg = $objEmailer->pg;
$acn = $objEmailer->acn;
$v = $objEmailer->v;
$State = $objEmailer->State;
$ReligionName = $objEmailer->ReligionName;
$sort = $objEmailer->sort;
$ReligionID = $objEmailer->ReligionID;
$field = $objEmailer->field;
$error = $objEmailer->error;
$msg = $objEmailer->msg;
$perpage = $objEmailer->perpage;
$start = $objEmailer->start;
$limit = $objEmailer->limit;
$SearchValue = $objEmailer->SearchValue;
$s = $objEmailer->s;
$sts = $objEmailer->sts;
$OrgID = $objCustomer->OrgID;
$BranchID = $objCustomer->BranchID;
$IndustryID = $objCustomer->IndustryID;
$rsEmailData = $objEmailer->FetchAllUsersData("All");
if($start == 1)
$limit = 0;
else if($start == 2)
$limit = $perpage;
else
$limit = ($start-1) * $perpage;
$objEmailer->limit = $limit;
$nume = count($rsEmailData);
$totalpage = @ceil(count($rsEmailData)/$perpage);
$rsEmailData = $objEmailer->FetchAllUsersData();
if($sort == '0'){
$sort = '1';
}
else{
$sort = '0';
}
$link = "";
if( $start != "" && $start != 0 ){
$link .= "&start={$start}";
}
if( $perpage != "" && $perpage != 0 ){
$link .= "&perpage={$perpage}";
}
if(trim($s) != ""){
$link .= "&s={$s}";
}
//$Dash = "";
//if($_SESSION['UserInfo']['UType'] == 'MasterAdmin'){
$Dash = "dashboardma";
//}else if($_SESSION['UserInfo']['UType'] == 'Admin'){
//$Dash = "dashboardadmin";
//}
?>
<div class="content-wrapper" style="height: 959px">
<?php
if( strtolower($v)=='add'|| strtolower($v)=='edit')
{}
else if($v=='list'){
?>
<section class="content-header">
<?php if(strtolower($v) == 'list'){?>
<h1> List of users </h1>
<ol class="breadcrumb">
<li><a href="dashboardma.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="emailer.html?v=list"><i class="fa users"></i>Emailer </a></li>
<li class="active">Purchase Request</li>
</ol>
<?php } ?>
</section>
<?php
// Error or success message display
$objDB->NotificaitonForResult($msg,$error)
?>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header">
<div class="col-md-12 col-xs-12 no-padding">
<div class="row">
<div class="col-md-12">
<form method="post" action="emailer.html" name="frmSearch" id="frmSearch">
<input type="hidden" name="start" id="start" value="<?php echo $start?>" />
<input type="hidden" name="perpage" id="perpage" value="<?php echo $perpage?>" />
<div class="col-md-1 col-xs-3 col-sm-2 col-lg-1 pull-left form-group no-padding ">
<a class="btn btn-info btn-sm" href="<?php echo $Dash; ?>.html"> <i class="fa fa-long-arrow-left"></i> Back </a>
</div>
<div class="col-md-3 col-xs-12 col-lg-2 form-group">
<?php $statusArr = array('all', 'new', 'approved', 'reject', 'hold', 'cancel'); ?>
<!--<span id="span_select" style="width:120px; height:35px; float:right;">-->
<select class="form-control input-md" id="org_list" onchange="javascript: window.location.href = 'emailer.html?v=list&sts='+this.value " name="Organization">
<option value="0">Filter by status</option>
<?php if(count($statusArr) > 0) {
foreach($statusArr as $val) {
?>
<option style="font-weight:bold;" <?php if($sts == $val) echo 'selected="selected"'; ?> value="<?php echo $val?>"><?php echo $val;?></option>
<?php } }else{ ?>
<option value="0">No any org. found</option>
<?php } ?>
</select>
<!--</span>-->
</div>
</form>
</div>
</div>
<div class="row">
<?php
if(count($rsEmailData) > 0 ) {
?>
<?php //echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v); ?>
<?php
}
?>
<!-------List of emailer----->
<div class="customers-list">
<div class="">
<div class="col-md-12">
<div class="table-responsive panel-default">
<table class="table table-fixed">
<thead>
<tr class="table-heder">
<th class="col-sm-1 text-center">Sr.No.</th>
<th class="col-sm-1 text-center">RequestID</th>
<th class="col-sm-2 text-center"><!--<a href="emailer.html?sort=<?=$sort?>&field=Religion_Name<?php echo $link?>">Name</a> <span> <a href="emailer.html?sort=<?=$sort?>&field=Religion_Name" > <?php if($field == 'Religion_Name' ) {
if($sort == 0){
echo '<i class="fa fa-sort-asc"></i>';
}else{
echo '<i class="fa fa-sort-desc"></i>';
}
} else { echo '<i class="fa fa-sort"></i>'; } ?> </a> </span> --> Org. Name </th>
<th class="col-sm-2 text-center">Quantity</th>
<th class="col-sm-2 text-center">Status</th>
<th class="col-sm-2 text-center">Created Date</th>
<th class="col-sm-2 text-center">Edit</th>
</tr>
</thead>
<?php
//print_r($rsEmailData);
if(count($rsEmailData)>0){
for ($i=0;$i< count($rsEmailData);$i++)
{
if($i%2)
$bgclass='altrow';
else
$bgclass='oddrow';
?>
<tr class="<?php echo $bgclass;?>" >
<td class="col-sm-1 text-center"><?php echo $i+1; ?></td>
<td class="col-sm-1 text-center"><?php echo $rsEmailData[$i]['uiqueid'];?></td>
<td class="col-sm-2 text-center"><?php echo $objEmailer->FetchOrganizationName($rsEmailData[$i]['orgid']); ?></td>
<td class="col-sm-2 text-center"><?php echo $rsEmailData[$i]['quantity']; ?></td>
<td class="col-sm-2 text-center"><?php echo $rsEmailData[$i]['status']; ?></td>
<td class="col-sm-2 text-center"><?php echo $rsEmailData[$i]['created_date']; ?></td>
<td class="col-sm-2 text-center">
<?php if( $rsEmailData[$i]['status'] == 'new') {?>
<a href="emailer.html?v=edit&&acn=cancelemailrequest&sts=<?php echo $sts?>&pid=<?php echo $rsEmailData[$i]['purchaseid'];?>">Cancel</a>
<?php }else {
echo '-';
} ?>
</td>
<!--<td class="col-sm-2 text-center"><label name="Organization Name"><?php //echo $objEmailer->FetchOrganizationName($rsEmailData[$i]['OrgID']); ?></label></td>
<td class="col-sm-2 text-center"><label name="Branch Name"><?php //echo $objEmailer->FetchBranchName($rsEmailData[$i]['BranchID']); ?></label></td>
<td class="col-sm-2 text-center"><label name="Industry Name"><?php //echo $objEmailer->FetchIndustryName($rsEmailData[$i]['IndustryID']); ?></label></td> -->
</tr>
<?php }
}else{
?>
<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>
<tr class="oddrow"> <td colspan="9" align="center"> No any record found. </td> </tr>
<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<style>
.customers-list .table-fixed tr:nth-child(even){background-color: #c7dae5; width: 100%; float: left;}
.customers-list .table-fixed thead { width: 100%;}
.customers-list .table-fixed tbody { height: 642px; overflow-y: auto; width: 100%;}
.customers-list .table-fixed thead, .table-fixed tbody, .customers-list .table-fixed tr, .table-fixed td, .customers-list .table-fixed th {display: block;}
.customers-list .table-fixed tbody td, .customers-list .table-fixed thead > tr> th { float: left; border-bottom-width: 0;}
.customers-list { width: 100%; float: left;}
.customers-list td.col-xs-2.text-center { font-size: 17px;}
.customers-list tr.table-heder { width: 100%; float: left; background: linear-gradient(#3c8dbc, #f2f2f2);}
.customers-list .panel-default { border: 2px solid #3c8dbc;border-radius: 5px !IMPORTANT;}
.customers-list { margin-bottom: 25px;}
</style>
</div>
<!------//-List of users-------->
<?php
if(count($rsEmailData) > 0 ) {
?>
<?php //echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v); ?>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<? } else if($v == 'report'){ ?>
<section class="content-header">
<h1> List of users </h1>
<ol class="breadcrumb">
<li><a href="dashboardma.html"><i class="fa fa-home"></i> Home</a></li>
<li><a href="emailer.html?v=report"><i class="fa users"></i>Emailer</a></li>
<li class="active">Email Report</li>
</ol>
</section>
<?php
// Error or success message display
$objDB->NotificaitonForResult($msg,$error)
?>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header">
<div class="col-md-12 col-xs-12 no-padding">
<div class="row">
<div class="col-md-12">
<form method="post" action="emailer.html" name="frmSearch" id="frmSearch">
<input type="hidden" name="start" id="start" value="<?php echo $start?>" />
<input type="hidden" name="perpage" id="perpage" value="<?php echo $perpage?>" />
<div class="col-md-1 col-xs-3 col-sm-2 col-lg-1 pull-left form-group no-padding ">
<a class="btn btn-info btn-sm" href="<?php echo $Dash; ?>.html"> <i class="fa fa-long-arrow-left"></i> Back </a>
</div>
<div class="col-md-6 form-group no-padding ">
<span> TOTAL RMAIN EMAILS <strong><?php echo fetchRemainPointClient('email'); ?></strong></span>
</div>
</form>
</div>
</div>
<div class="row">
<?php
if(count($rsEmailData) > 0 ) {
?>
<?php //echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v); ?>
<?php
}
?>
<!-------List of emailer----->
<div class="customers-list">
<div class="">
<div class="col-md-6">
<div class="table-responsive panel-default">
<table class="table table-fixed">
<thead>
<tr class="table-heder">
<th class="col-sm-1 text-center">Sr.No.</th>
<th class="col-sm-5 text-center">Point</th>
<th class="col-sm-6 text-center">Created Date</th>
</tr>
</thead>
<?php
//print_r($rsEmailData);
if(count($rsEmailData)>0){
for ($i=0;$i< count($rsEmailData);$i++)
{
if($i%2)
$bgclass='altrow';
else
$bgclass='oddrow';
?>
<tr class="<?php echo $bgclass;?>" >
<td class="col-sm-1 text-center"><?php echo $i+1; ?></td>
<td class="col-sm-5 text-center"><?php echo $rsEmailData[$i]['point']; ?></td>
<td class="col-sm-6 text-center"><?php echo $rsEmailData[$i]['created_date']; ?></td>
</tr>
<?php }
}else{
?>
<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>
<tr class="oddrow"> <td colspan="9" align="center"> No any record found. </td> </tr>
<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="col-md-3">
<div class="box box-warning box-solid tle-box">
<div class="box-header with-border tle-box-top">
<h3 class="box-title">TOTAL RMAIN EMAILS</h3>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="tle-box-bottom">
<span> <i class="fa fa-envelope" aria-hidden="true"></i></span> <span><strong><?php echo fetchRemainPointClient('email'); ?></strong></span>
<p class="f-bounes" style=""><i><?php echo ucwords(number_to_word(fetchRemainPointClient('email'))); ?></i></p>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<style>
.customers-list .table-fixed tr:nth-child(even){background-color: #c7dae5; width: 100%; float: left;}
.customers-list .table-fixed thead { width: 100%;}
.customers-list .table-fixed tbody { height: auto; overflow-y: auto; width: 100%;}
.customers-list .table-fixed thead, .table-fixed tbody, .customers-list .table-fixed tr, .table-fixed td, .customers-list .table-fixed th {display: block;}
.customers-list .table-fixed tbody td, .customers-list .table-fixed thead > tr> th { float: left; border-bottom-width: 0;}
.customers-list { width: 100%; float: left;}
.customers-list td.col-xs-2.text-center { font-size: 17px;}
.customers-list tr.table-heder { width: 100%; float: left; background: linear-gradient(#3c8dbc, #f2f2f2);}
.customers-list .panel-default { border: 2px solid #3c8dbc;border-radius: 5px !IMPORTANT;}
.customers-list { margin-bottom: 25px;}
</style>
</div>
<!------//-List of users-------->
<?php
if(count($rsEmailData) > 0 ) {
?>
<?php //echo pagination_log($s,$perpage,$start,$nume,$totalpage,$pg,$v); ?>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
</section>
</div>