<?php require "_header.php";?>
 <style type="text/css">
  *{  padding:0px;
   margin:0px;}
#content
{
    min-height: 330px;

   /* overflow: hidden;*/
    width: 100%;
}
#content a {
    color: #336797;
    text-decoration: none;
}
#content a:hover {
    color: #478ED0;
    text-decoration: underline;
}
.flL{float:left;}
.flR
{
float:right;	
}
#content .left-content
{
	width:300px;
	height: auto;
}
#content .right-content
{
	width:300px;
	padding-right:5px;
	
}
#content .right-inout
{
	width:100px;
	padding-right:5px;
	
} 
.mstpplr {
    background-color: #393939;
    color: #FFFFFf;
    font-family: Arial Black,Arial,georgia;
    font-size: 14px;
    padding: 3px 0 3px 5px;
    text-align: left;
}
.latdatadiv {
    border-bottom: 1px solid #D7D7D7;
    border-left: 1px solid #D7D7D7;
    border-right: 1px solid #D7D7D7;
     display: block;
    text-align: left;
    width: 298px;
	overflow-x: hidden;
    overflow-y: auto;
	height:900px;
}
  .clrb {
    clear: both;
    content: ".";
    display: block;
    height: 0;
  
}
.mstcom 
{
	padding:0 7px;
}
.mstcom div {
      /*georgia*/
    font-family: Arial, Helvetica, sans-serif;  
    font-size: 14px;
    margin-top: 7px;
    padding: 0 0 5px 9px;
    width: 264px;
} 
#newscontent
{
	padding:20px 0px 20px 5px;
	margin-left: 5px;
}
.hd {
     border-bottom: 2px solid #93BF35;
    float: left;
    min-width: 550px;
	
   
}
.hd h4 {
   text-align: left;
   float:left;
}
h4 {
    font: 26px Georgia,"Times New Roman",Times,serif;
    
}
.newslongdec
{
	text-align:left;
	
	padding-top:10px;
	clear:both;
}

#newscontent .datedisp{
	color: #660066;
    display: block;
    float: left;
    
    padding-top: 6px;
    text-decoration: none;}
#newscontent p
{
	margin-top:10px;
	margin-bottom:10px;
}
.jsconfirm 
{
	font-weight:bold;
	color:#C00;
}
#divnews {float:right;}
#pnlDiv {margin-top:15px;margin-left:25px;margin-right:25px; width:300px;}
	#pnlDiv1 {float:left;margin-top:80px;margin-right:290px;width:300px;}
#pnlDivContent {padding-left:5px;font-family:Arial,Helvetica,sans-serif;}
.ntitle {font-weight:bold;padding-bottom:5px;font-size:9pt;padding-top:5px;}
.ntitlenotvisite a {color:#F00;text-decoration:none;}
.ntitle a {color:#000066;text-decoration:none;}


	.table-report{
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
		text-align:left;
		border-right:0px none;
		border-bottom:0px none;
		
	}
	.table-report-inner{
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
	}
	.table-report tr{
		padding:2px 2px 2px 2px;
	}
	.table-report td{
		padding:2px 2px 2px 2px;
		border-top:0px none;
		border-left:0px none;
	}
	.table-report th{
		padding:2px 2px 2px 2px;
		font-weight:bold;
	
		border-top:0px none;
		border-left:0px none;
	}
		.table-report-footer{ 
 	 		font-family:Verdana, Geneva, sans-serif; 
 			font-size:10px; 
    }
	.college_name{
		font-family:QTAbbie;
		font-size:22px;	
		font-weight:bold;
		padding:2px 2px 2px 2px;
		text-align:center;
	}
	.college_address
	{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:11px;	
		text-align:center;
		padding:2px 2px 2px 2px;
	}
	.report_name{
		font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
		font-size:13px;	
		background-color:#CCC;
		text-align:center;
		font-weight:bold;
		padding:2px 2px 2px 2px;
	}
	.left{
		float:left;
		width:50%;
	}
	.right{
		float:right;
		width:50%;
	}
	.break 
	{ 
	page-break-before: always; 
	}
		




</style>
<script type="text/javascript" src="js/themes.js"></script>
<script type="text/javascript" src="jquery/ux/fileuploadfield/FileUploadField.js"></script>
<link rel="stylesheet" type="text/css" href="jquery/ux/fileuploadfield/css/fileuploadfield.css"/>
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="jquery/ux/css/statusbar.css"/>
<link rel="stylesheet" type="text/css" href="css/xtheme-gray.css" />
<!--<script type="text/javascript" src="webcamjs/webcam.js"></script>
<script src="js/photocapture.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.min1.js" ></script>-->

<?php

 $date1= date('Y-m-d');
 
 //echo $date1; exit;


$ach = "select im.*,pm.*,um.* from lms_inquiry as im,lms_productmaster as pm, lms_usermaster as um where im.product_ids=pm.product_id and im.user_id=um.user_id and im.appointmentdate >= '".$date1."' order by im.appointmentdate asc ";
	$resach = dbQuery($ach);

//echo $date1; exit;

//echo $date1;
//echo $ach; 
?>
<script language="javascript" type="text/javascript">
	Ext.onReady(function() { 	 
	 	new Ext.Panel({ title:"Inquiry", renderTo: 'pnlDiv1', height:300, autoScroll:true, width:483,contentEl: 'contentBirth'});
	});
</script>
<div id="main-content" align="right"> 

    <div id="theme">



  <!--      <form id="styleswitcher">


            <label for="styleswitcher_select">Choose Theme: </label>
            <select name="styleswitcher_select" id="styleswitcher_select">
                <option value="blue" selected="true">Blue Theme</option>
                <option value="gray">Gray Theme</option>
                <option value="access">Accessibility Theme</option>
                <option value="yourtheme">Your Theme</option>
                <option value="slate">Slate</option>
            </select>
        </form> -->
    </div>

	<div id="pnlDiv1">
		
	</div>	
<?php 
if($_SESSION['cUserName'] != 'account')
{
?>
 <div id="contentBirth" class="x-hidden">
</br>
 	<table border="1"  width="100%" align="center">
		<tr style="background-color:#CCC">
			<th colspan="7"><center><font size="3"><b>Upcoming Inquiry</b></font></center></th>
		</tr>	
		
		<tr style="background-color:#CCC">
			
			<th><b><center>Name</center></b></th>
			<th><b><center>Old Orgenization</center></b></th>
			<th><b><center>New Orgenization</center></b></th>
			
			<th><b><center>Contact Person</center></b></th>
			<th><b><center>Inquiery Date</center></b></th>
			<th><b><center>Appointment Date</center></b></th>
			<th><b><center>Inquiery Time</center><b></th>
			
			</tr>
	<?php
		while($record = dbArray($resach)){
			?>
			<?php
			
			$r=$record['appointmentdate']; 
			
			
			
				if($r  < date('Y-m-d',strtotime("+3 days")))
				{
			 	
		?>
		
	<tr style="background-color:yellow">
		
		<td >
			<?=$record['name'];?>
		</td>
		
			<td >
			<?=$record['customer_id'];?>
		</td>
		
			<td >
			<?=$record['inquierorg_name'];?>
		</td>

		
			<td >
			<?=$record['inquier_mobileno'];?>
		</td>
		
			<td>
			<?=date("d/m/Y",strtotime($record['inquiry_date']));?>
		</td>
				<td>
			<?=date("d/m/Y",strtotime($record['appointmentdate']));?>
		</td>
		<td >
			<?=$record['appointmenttime'];?>
		</td>
			
			
			
	</tr>
	<?php
}
else
{
?>	
	<tr >
		
		<td >
			<?=$record['name'];?>
		</td>
		
			<td >
			<?=$record['customer_id'];?>
		</td>
		
			<td >
			<?=$record['inquierorg_name'];?>
		</td>

		
			<td >
			<?=$record['inquier_mobileno'];?>
		</td>
			<td>
			<?=date("d/m/Y",strtotime($record['inquiry_date']));?>
		</td>
			<td>
			<?=date("d/m/Y",strtotime($record['appointmentdate']));?>
		</td>
			
		<td >
			<?=$record['appointmenttime'];?>
		</td>
			
			
			
	</tr>	
	
<?php
}
?>	
	
		
<?php
}
?>	
	
</table>

</div>
<div id="divnews" >
    	
 </div>
 </div>
       <script type="text/javascript" language="javascript"> 
var customerstore = new Ext.data.Store({
		url: 'data/get_customersupport.php',          
		reader: new Ext.data.JsonReader({			
	fields: ['customer_id','cust_id','date1','customer_orgname','status','user_id','user_name','assign_user_id','asign_user_name'],
			root: 'rows1'
		}),autoLoad:true
	}); 

Ext.QuickTips.init();
	
Ext.onReady(function() {
	var colModel = new Ext.grid.ColumnModel([
		new Ext.grid.RowNumberer(),
		{ 
			header: "cust_id", 
			dataIndex:'cust_id', 
			sortable: true, 
			hidden: true 
		},{ 
			header: "customer_id", 
			dataIndex:'customer_id', 
			sortable: true, 
			hidden: true 
		},
		{
			header: "Edit",	
			width:30,
		    renderer: function(value, metaData, record, rowIndex, colIndex, store) 
			{
    	   		return '<a href="addedit-custsupport.php?customer_id='+ record.get('customer_id')+'&cust_id='+record.get('cust_id')+'">Edit</a>';
			}
		},{ 
			id: 'customer_orgname',
			header: "Customer Name",
			width: 140,
			dataIndex: 'customer_orgname',
			align: 'center',
			//hidden: true 
        },{ 
			id:'date1',
			dataIndex: 'date1',
			header: 'Date ',
			align: 'center',
			width: 60
		},{ 
			id:'status',
			dataIndex: 'status',
			header: 'Status ',
			align: 'center',
			 renderer: function(v, params, record){
				var price=record.get('status');
				if(v =='Pending'){
					return '<span style="color:red;">' + v + '</span>';
				}else{
					return '<span style="color:blue;">' + v + '</span>';
				}
			},
			width:60
		},{ 
			id:'user_id',
			dataIndex: 'user_name',
			header: 'User Name ',
			align: 'left',
			width: 60
		},{ 
			id:'assign_user_id',
			dataIndex: 'asign_user_name',
			header: 'Asign To',
			align: 'left',
			width: 70
		}
    ]);
	
	var grid = new Ext.grid.GridPanel({
		ds: customerstore,
		cm: colModel,
		renderTo:'divnews',
		stripeRows: true,
		sm: new Ext.grid.RowSelectionModel({
			singleSelect: true,
		}),
		tbar: [
			{
			xtype:'button',
			text: 'Add Customer Support ',
			iconCls:'icon-add',
			id:'add_cust',	
			handler: function () {
				 window.location = 'addedit-custsupport.php';
			}
		}],
		//autoHeight:true
		height: 400,
		border: true,
		frame:true
	});
	
	grid.on('render', function(){
		grid.tip = new Ext.ToolTip({
    		view: grid.getView(),
    		target: grid.getView().mainBody,
    		delegate: '.x-grid3-row',
    		trackMouse: true,
    		renderTo: document.body,
    		listeners: {
     			beforeshow: function updateTipBody(tip) {
      				tip.body.dom.innerHTML = "Please click here to edit record.";
     			}
    		}

   		});
  	});
	
	/*var customer_form = new Ext.FormPanel({	
		id: 'customer_form',
		frame: true,
		autoHeight:true,
		//url: 'save-medicien-in-group.php',
    	labelAlign: 'left',
		
  		bodyStyle:'padding:5px',
   		layout: 'column',
    	items: [{
				columnWidth: 1,
				layout: 'fit',
				items:[{		
							xtype:'button',
							id:'Add',
							fieldLabel:'Add Customer Support',
							//iconCls:'icon-add',
							handler: function()
							{  
							   returnId = 1;
							   window.location = 'addedit-custsupport.php';  										   
							  
							}
				},grid],
				
			}
        ]
    });*/
	
});



</script>
<?php 

$ach1 = "SELECT count( * ) AS a
FROM lms_inquiry
WHERE lms_inquiry.appointmentdate <= '".$date1."' and lms_inquiry.inquiry_id NOT
IN (

SELECT lms_followup.inquiry_id
FROM lms_followup
)
";
	$resach1 = dbQuery($ach1);
$record1 = dbArray($resach1)
?>
</br>
</br>
	<a href="report-customer-not-follow.php"><marquee><font size="3" color="red"><?php echo 'You Had Not Follow &nbsp;' .$record1['a']. '&nbsp; Customer, Please Refere Follow up Report'; ?></font></marquee></a>
 <?php }
 require "_footer.php";?>