<?php
if($_REQUEST['action']=='Delete')
{
$del1=DB_query("delete from dbl_enquiry_details where parent_id='".$_REQUEST['id']."'",$db);
$del=DB_query("delete from dbl_enquiry_form where id='".$_REQUEST['id']."'",$db);
$s->pageLocation('index.php?route=DealerDistrbutions/Transaction/enquiry_index&modid='.$_REQUEST['modid'].'&frmid='.$_REQUEST['frmid'].'');
} 
if($_REQUEST['action']=='Cancel')
{
$update=DB_query("update dbl_enquiry_form set close_status=1 where id='".$_REQUEST['mrnid']."'",$db);
$s->pageLocation('index.php?route=DealerDistrbutions/Transaction/enquiry_index&modid='.$_REQUEST['modid'].'&frmid='.$_REQUEST['frmid'].'');
}
if($_REQUEST['Conver'])
{
$chkecdId=implode(",",$_REQUEST['enquiry_id']);
$s->pageLocation('index.php?route=DealerDistrbutions/Transaction/Multi_sale_order_creations&modid='.$_REQUEST['modid'].'&frmid='.$_REQUEST['frmid'].'&id='.$chkecdId.'');
}




?>
<?php
$table='dbl_enquiry_form';
$action=$_REQUEST['action'];
$daction=$_REQUEST['daction'];
$msgErr='';
$status=true;
 $modid=$_REQUEST['modid'];
$frmid=$_REQUEST['frmid'];
$url="&modid=".$modid."&frmid=".$frmid;
$targetpage="index.php?route=DealerDistrbutions/Transaction/enquiry_form".$url;
$targetpage1="index.php?route=DealerDistrbutions/Transaction/enquiry_index".$url;


?>
<link rel="stylesheet" href="css/new_mxerp.css">
<p>&nbsp;</p>
<div class="body_contain">
<div class="tab_div">
<h1>Enquiry Forms Details</h1>
 <form name="myform" id="myform" method="post">
 <div align="left"> <a href="<?php echo $targetpage; ?>&amp;action=Addnew">
<input type="button" name="Add New" value="Add New" class="search" /></a>
<a href="index.php?route=DealerDistrbutions/Transaction/Multi_sale_order_creations<?php echo $url; ?>">
<input type="submit" name="Conver" value="Convert Multiple Enq into SOI" onclick="return checkenqueryno1();"  class="search"  />
</a>
</div>
<br />
 
<div id="showdatacontain">
<?php  include('Viewenquiry.php') ?> </div>
</form>
</div></div>
<script type="text/javascript" language="javascript">
function checkenqueryno1()
{
	var myform = document.getElementById('myform');
	var inputTags = myform.getElementsByTagName('input');
	var checkboxCount = 0;
	for (var i=0, length = inputTags.length; i<length; i++) {
	var input=inputTags[i];
	if (inputTags[i].type == 'checkbox' && input.checked) {
	checkboxCount++;
	}
	}
	if(checkboxCount<2)
	{
	alert("Please Check At Least Two Check Box Of Same Customer");
	return false;
	}
	
}


</script>
<script>
function showicon(str)
{
document.getElementById(str).style.display='none';
document.getElementById("show").style.display='block';

if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{
	document.getElementById("showdatacontain").innerHTML=xmlhttp.responseText;
	//document.getElementById("subcategory1").innerHTML=data[0];
	}
	}






}
function showicon1(str)
{

document.getElementById(str).style.display='none';
document.getElementById("hideicon").style.display='block';

}
</script>