PHP表单未提交。当我按块/ GP选项单击报告并选择选项并提交时,它不会显示任何仅提供默认值的结果。这段代码在我的localhost上工作正常。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function getState(districtId) {
var strURL="http://sbmpunjab.com/sbmpunjab/website_control/admin_form/constituency_report.php?district="+districtId;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
var returnedData = JSON.parse(req.responseText);
$('#Constituencydiv select[name=constituency]').html(returnedData.constituency);
$('#Blockdiv').html(returnedData.block);
$('#Divisionsdiv select[name=divisions]').html(returnedData.divisions);
document.getElementById('GramPanchdiv').innerHTML='<select name="grampanch"><option>Select Gram Panchayat</option></select>';
} else {
alert("Problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
function getCity(districtId,blockId) {
var
strURL="http://sbmpunjab.com/sbmpunjab/website_control/admin_form/village_report.php?district="+districtId+"&block="+blockId;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
var returnedData = JSON.parse(req.responseText);
$('#GramPanchdiv select[name=grampanch]').html(returnedData.GramPanch);
} else {
alert("Problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height="20" colspan="2" align="center">
<h4>Beneficiary Report</h4>
</td>
</tr>
<br />
<? if($Section=='' || $Section=='SearchBlock'){?>
<tr>
<td><b>Search options</b>
<a href="<?=DIR_WS_SITE_CONTROL?>index.php?Page=<?=$Page?>&search=block">Report by Block/GP</a>
</td><br/>
</tr>
<?}?>
<?php $search =isset($_GET['search'])?$_GET['search']:"";
if($search=='block'){?>
<tr>
<td>
<form id="searchBform" name="searchBform" action="<?=DIR_WS_SITE_CONTROL?>index.php?Page=<?=$Page?>&Section=SearchBlock1" method="POST">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="InsideTable">
<tr>
<td width="20%" class="InsideLeftTd"><b>District</b></td>
<td class="InsideRightTd">
<select name="district" id="district" title="Please select district." onChange="getState(this.value)">
<?
$DefaultDistrict = isset($_POST['district'])?MyStripSlashes($_POST['district']):(isset($CurrentBF->district_id)?MyStripSlashes($CurrentBF->district_id):DEFINE_DEFAULT_DISTRICT);
$DistrictObj = new DataTable(TABLE_DISTRICT);
$DistrictObj->TableSelectAll("","district ASC");
while ($CurrentDistrict = $DistrictObj->GetObjectFromRecord())
{
?>
<option value="<?=$CurrentDistrict->id?>" <?=$DefaultDistrict==$CurrentDistrict->id?"selected":""?>><?=$CurrentDistrict->district?></option>
<?
}
?>
</select>
</td>
</tr>
<?php
if(isset($CurrentBF->district_id) && $CurrentBF->district_id!='0'){
$BlockObj = new DataTable(TABLE_BLOCKS);
$BlockObj ->Where ="district_id='".$CurrentBF->district_id."'";
$BlockObj->TableSelectAll();
}
?>
<tr>
<td width="20%" class="InsideLeftTd"><b>Block</b></td>
<td class="InsideRightTd">
<div id="Blockdiv">
<? if(isset($CurrentBF->district_id) && $CurrentBF->district_id!='0'){?>
<select name="block" onchange="getCity('<?php echo $CurrentBF->district_id; ?>', this.value)" >
<?while ($CurrentBlock = $BlockObj->GetObjectFromRecord())
{
?>
<option value="<?=$CurrentBlock->id?>"<?=$CurrentBlock->id==$CurrentBF->block_id ? "selected":""?>> <?=$CurrentBlock->block_name ?></option>
<?
}
?>
</select>
<?}?>
<option>Select Block</option>
</div>
</td>
</tr>
<tr>
<td width="20%" class="InsideLeftTd"><b>Gram Panchayat</b></td>
<td class="InsideRightTd">
<div id="GramPanchdiv">
<select name="grampanch" >
<option>Select Gram Panchayat</option>
</select></div>
</tr>
<tr>
<td><input type="submit" name="submit" title="Search"></td>
</tr>
</table>
</form>
</td>
</tr>
<?}?>
<tr><td><br/></td></tr>
</table>
<?php
//// Section start
switch($Section)
{
case "district_report":
default:
$DistrictObj = new DataTable(TABLE_DISTRICT);
$DistrictObj->Where = "1";
$DistrictObj->TableSelectAll();
?>
<table cellpadding="5" cellspacing="1" border="0" class="InsideTable">
<tr class="InsideLeftTd">
<td width="2%" height="25"><b>S.No</b></td>
<td width="10%" align="left"><b>District</b></td>
<td width="8%" align="left"><b>Number of beneficiaries Entered online</b></td>
<td width="10%" align="left"><b>Number Beneficiaries whose picture uploaded</b></td>
<td width="15%"><b>Number beneficiaries whose electricity bill uploaded</b></td>
<td width="15%"><b>Number beneficiaries whose bank pass book uploaded</b></td>
<td width="15%"><b>Number of Picture stage 1 uploaded</b></td>
<td width="15%"><b>Number of Picture stage 2 uploaded</b></td>
<td width="15%"><b>Number of Picture stage 3 uploaded</b></td>
<td width="15%"><b>Number of latrines for which Ist Installment issue</b></td>
<td width="15%"><b>Number of latrines for which IInd Installment issue</b></td>
</tr>
<?
$SNo=1;
$Count=1;
while($CurrentDis=$DistrictObj->GetObjectFromRecord())
{
$bObj = new DataTable(TABLE_BENEFICIARY);
$bObj->Where = "district_id='".$CurrentDis->id."'";
$bObj->TableSelectAll("","");
$bObj1 = new DataTable(TABLE_BENEFICIARY);
$bObj1->Where = "district_id='".$CurrentDis->id."' AND beneficiary_image!=''";
$bObj1->TableSelectAll("","");
$bObj2 = new DataTable(TABLE_BENEFICIARY);
$bObj2->Where = "district_id='".$CurrentDis->id."' AND elec_bill_image!=''";
$bObj2->TableSelectAll("","");
$bObj3 = new DataTable(TABLE_BENEFICIARY);
$bObj3->Where = "district_id='".$CurrentDis->id."' AND bank_pass_book_image!=''";
$bObj3->TableSelectAll("","");
$ImgObj = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj->Where ="b.district_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='1' AND bimg.Image !=''";
$ImgObj->TableSelectAll();
$ImgObj1 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj1->Where ="b.district_id='".$ImgObj1->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Image !=''";
$ImgObj1->TableSelectAll();
$ImgObj2 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj2->Where ="b.district_id='".$ImgObj2->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Image !=''";
$ImgObj2->TableSelectAll();
$ImgObj3 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj3->Where ="b.district_id='".$ImgObj3->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Complete='1'";
$ImgObj3->TableSelectAll();
$ImgObj4 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj4->Where ="b.district_id='".$ImgObj4->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Complete='1'";
$ImgObj4->TableSelectAll();
?>
<tr class="InsideRightTd">
<td height="25" align="center" style="color:black"><?=$SNo?>.</td>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->district);?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj2->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj3->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj2->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj3->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj4->GetNumRows())?></td>
</tr>
<?
$SNo++;
$Count++;
}
$bObj1 = new DataTable(TABLE_BENEFICIARY);
$bObj1->Where = "1";
$bObj1->TableSelectAll();
$bObj12 = new DataTable(TABLE_BENEFICIARY);
$bObj12->Where = "beneficiary_image!=''";
$bObj12->TableSelectAll("","");
$bObj23 = new DataTable(TABLE_BENEFICIARY);
$bObj23->Where = "elec_bill_image!=''";
$bObj23->TableSelectAll("","");
$bObj34 = new DataTable(TABLE_BENEFICIARY);
$bObj34->Where = "bank_pass_book_image!=''";
$bObj34->TableSelectAll("","");
$IObj = new DataTable(TABLE_BENEFICIARY_IMAGES);
$IObj ->Where ="Stage='1' AND Image !=''";
$IObj->TableSelectAll();
$IObj1 = new DataTable(TABLE_BENEFICIARY_IMAGES);
$IObj1 ->Where ="Stage='2' AND Image !=''";
$IObj1->TableSelectAll();
$IObj2 = new DataTable(TABLE_BENEFICIARY_IMAGES);
$IObj2 ->Where ="Stage='3' AND Image !=''";
$IObj2->TableSelectAll();
$IObj3 = new DataTable(TABLE_BENEFICIARY_IMAGES);
$IObj3 ->Where ="Stage='2' AND Complete='1'";
$IObj3->TableSelectAll();
$IObj4 = new DataTable(TABLE_BENEFICIARY_IMAGES);
$IObj4 ->Where ="Stage='3' AND Complete='1'";
$IObj4->TableSelectAll();
?>
<tr>
<td colspan="10"><hr></td>
</tr>
<tr class="InsideRightTd">
<td height="25" align="center"></td>
<td align="left"><b>Total</b></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj12->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj23->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj34->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($IObj->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($IObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($IObj2->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($IObj3->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($IObj4->GetNumRows())?></td>
</tr>
</table>
<?php
break;
case "SearchBlock1" :
$did = isset($_REQUEST['district'])?$_REQUEST['district']:"";
$bid = isset($_REQUEST['block'])?$_REQUEST['block']:"";
$gpid= isset($_REQUEST['grampanch'])?$_REQUEST['grampanch']:"";
if(isset($bid) && $bid!='' && isset($gpid) && $gpid!=''){
$searchIDObj = new DataTable(TABLE_GRAM_PANCHAYAT);
$searchIDObj->Where ="block_id='".$bid."' AND id='".$gpid."'";
}elseif(isset($bid) && $bid!=''){
$searchIDObj = new DataTable(TABLE_GRAM_PANCHAYAT);
$searchIDObj->Where ="block_id='".$bid."'";
}else{
$searchIDObj = new DataTable(TABLE_BLOCKS);
$searchIDObj->Where ="district_id='".$did."'";
}
$searchIDObj->TableSelectAll("","id ASC");
if($searchIDObj->GetNumRows() > 0)
{
?>
<table cellpadding="5" cellspacing="1" border="0" class="InsideTable">
<tr class="InsideLeftTd">
<td width="2%" height="25"><b>S.No</b></td>
<?if(isset($bid) && $bid!='' && isset($gpid) && $gpid!=''){?>
<td width="10%" align="left"><b>District</b></td>
<td width="10%" align="left"><b>Block</b></td>
<td width="10%" align="left"><b>GP</b></td>
<?}elseif(isset($bid) && $bid!=''){?>
<td width="10%" align="left"><b>District</b></td>
<td width="10%" align="left"><b>Block</b></td>
<td width="10%" align="left"><b>GP</b></td>
<?}else{?>
<td width="10%" align="left"><b>District</b></td>
<td width="10%" align="left"><b>Block</b></td>
<?}?>
<td width="8%" align="left"><b>Number of beneficiaries Entered online</b></td>
<td width="10%" align="left"><b>Number Beneficiaries whose picture uploaded</b></td>
<td width="15%"><b>Number beneficiaries whose electricity bill uploaded</b></td>
<td width="15%"><b>Number beneficiaries whose bank pass book uploaded</b></td>
<td width="15%"><b>Number of Picture stage 1 uploaded</b></td>
<td width="15%"><b>Number of Picture stage 2 uploaded</b></td>
<td width="15%"><b>Number of Picture stage 3 uploaded</b></td>
<td width="15%"><b>Number of latrines for which Ist Installment issue</b></td>
<td width="15%"><b>Number of latrines for which IInd Installment issue</b></td>
</tr>
<?
$SNo=1;
$Count=1;
while($CurrentDis=$searchIDObj->GetObjectFromRecord())
{
if(isset($CurrentDis->id) && $CurrentDis->id!='' && isset($CurrentDis->block_id) && $CurrentDis->block_id!=''){
$bObj = new DataTable(TABLE_BENEFICIARY);
$bObj->Where = "village_id='".$CurrentDis->id."' AND block_id='".$CurrentDis->block_id."' ";
$bObj->TableSelectAll("","");
$bObj1 = new DataTable(TABLE_BENEFICIARY);
$bObj1->Where = "block_id='".$CurrentDis->block_id."' AND village_id='".$CurrentDis->id."' AND beneficiary_image!=''";
$bObj1->TableSelectAll("","");
$bObj2 = new DataTable(TABLE_BENEFICIARY);
$bObj2->Where = "block_id='".$CurrentDis->block_id."' AND village_id='".$CurrentDis->id."' AND elec_bill_image!=''";
$bObj2->TableSelectAll("","");
$bObj3 = new DataTable(TABLE_BENEFICIARY);
$bObj3->Where = "block_id='".$CurrentDis->block_id."' AND village_id='".$CurrentDis->id."' AND bank_pass_book_image!=''";
$bObj3->TableSelectAll("","");
$ImgObj = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj->Where ="b.block_id='".$ImgObj->MysqlEscapeString($CurrentDis->block_id)."' AND b.village_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='1' AND bimg.Image !=''";
$ImgObj->TableSelectAll();
$ImgObj1 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj1->Where ="b.block_id='".$ImgObj->MysqlEscapeString($CurrentDis->block_id)."' AND b.village_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Image !=''";
$ImgObj1->TableSelectAll();
$ImgObj2 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj2->Where ="b.block_id='".$ImgObj->MysqlEscapeString($CurrentDis->block_id)."' AND b.village_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Image !=''";
$ImgObj2->TableSelectAll();
$ImgObj3 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj3->Where ="b.block_id='".$ImgObj->MysqlEscapeString($CurrentDis->block_id)."' AND b.village_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Complete='1'";
$ImgObj3->TableSelectAll();
$ImgObj4 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj4->Where ="b.block_id='".$ImgObj->MysqlEscapeString($CurrentDis->block_id)."' AND b.village_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Complete='1'";
$ImgObj4->TableSelectAll();
}elseif(isset($CurrentDis->id) && $CurrentDis->id!='' && isset($CurrentDis->district_id) && $CurrentDis->district_id!=''){
$bObj = new DataTable(TABLE_BENEFICIARY);
$bObj->Where = "block_id='".$CurrentDis->id."' AND district_id='".$CurrentDis->district_id."' ";
$bObj->TableSelectAll("","");
$bObj1 = new DataTable(TABLE_BENEFICIARY);
$bObj1->Where = "district_id='".$CurrentDis->district_id."' AND block_id='".$CurrentDis->id."' AND beneficiary_image!=''";
$bObj1->TableSelectAll("","");
$bObj2 = new DataTable(TABLE_BENEFICIARY);
$bObj2->Where = "district_id='".$CurrentDis->district_id."' AND block_id='".$CurrentDis->id."'AND elec_bill_image!=''";
$bObj2->TableSelectAll("","");
$bObj3 = new DataTable(TABLE_BENEFICIARY);
$bObj3->Where = "district_id='".$CurrentDis->district_id."' AND block_id='".$CurrentDis->id."'AND bank_pass_book_image!=''";
$bObj3->TableSelectAll("","");
$ImgObj = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj->Where ="b.district_id='".$ImgObj->MysqlEscapeString($CurrentDis->district_id)."' AND b.block_id='".$CurrentDis->id."' AND bimg.Stage='1' AND bimg.Image !=''";
$ImgObj->TableSelectAll();
$ImgObj1 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj1->Where ="b.district_id='".$ImgObj1->MysqlEscapeString($CurrentDis->district_id)."' AND b.block_id='".$CurrentDis->id."' AND bimg.Stage='2' AND bimg.Image !=''";
$ImgObj1->TableSelectAll();
$ImgObj2 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj2->Where ="b.district_id='".$ImgObj2->MysqlEscapeString($CurrentDis->district_id)."' AND b.block_id='".$CurrentDis->id."' AND bimg.Stage='3' AND bimg.Image !=''";
$ImgObj2->TableSelectAll();
$ImgObj3 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj3->Where ="b.district_id='".$ImgObj3->MysqlEscapeString($CurrentDis->district_id)."' AND b.block_id='".$CurrentDis->id."' AND bimg.Stage='2' AND bimg.Complete='1'";
$ImgObj3->TableSelectAll();
$ImgObj4 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj4->Where ="b.district_id='".$ImgObj4->MysqlEscapeString($CurrentDis->district_id)."' AND b.block_id='".$CurrentDis->id."' AND bimg.Stage='3' AND bimg.Complete='1'";
$ImgObj4->TableSelectAll();
}else{
$bObj = new DataTable(TABLE_BENEFICIARY);
$bObj->Where = "district_id='".$CurrentDis->id."'";
$bObj->TableSelectAll("","");
$bObj1 = new DataTable(TABLE_BENEFICIARY);
$bObj1->Where = "district_id='".$CurrentDis->id."' AND beneficiary_image!=''";
$bObj1->TableSelectAll("","");
$bObj2 = new DataTable(TABLE_BENEFICIARY);
$bObj2->Where = "district_id='".$CurrentDis->id."' AND elec_bill_image!=''";
$bObj2->TableSelectAll("","");
$bObj3 = new DataTable(TABLE_BENEFICIARY);
$bObj3->Where = "district_id='".$CurrentDis->id."' AND bank_pass_book_image!=''";
$bObj3->TableSelectAll("","");
$ImgObj = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj->Where ="b.district_id='".$ImgObj->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='1' AND bimg.Image !=''";
$ImgObj->TableSelectAll();
$ImgObj1 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj1->Where ="b.district_id='".$ImgObj1->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Image !=''";
$ImgObj1->TableSelectAll();
$ImgObj2 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj2->Where ="b.district_id='".$ImgObj2->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Image !=''";
$ImgObj2->TableSelectAll();
$ImgObj3 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj3->Where ="b.district_id='".$ImgObj3->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='2' AND bimg.Complete='1'";
$ImgObj3->TableSelectAll();
$ImgObj4 = new DataTable(TABLE_BENEFICIARY." b INNER JOIN ".TABLE_BENEFICIARY_IMAGES." bimg on (b.id = bimg.beneficiary_id)");
$ImgObj4->Where ="b.district_id='".$ImgObj4->MysqlEscapeString($CurrentDis->id)."' AND bimg.Stage='3' AND bimg.Complete='1'";
$ImgObj4->TableSelectAll();
}
?>
<tr class="InsideRightTd">
<td height="25" align="center" style="color:black"><?=$SNo?>.</td>
<?if(isset($CurrentDis->id) && $CurrentDis->id!='' && isset($CurrentDis->village_name) && $CurrentDis->village_name!=''){?>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->district_name);?></td>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->block_name);?></td>
<td align="left" style="color:black"><a href="<?=DIR_WS_SITE_CONTROL?>index.php?Page=beneficiary&Section=SearchBlock&block=<?=$CurrentDis->block_id?>&grampanch=<?=$CurrentDis->id?>"><?=MyStripSlashes($CurrentDis->village_name);?></a></td>
<?}elseif(isset($CurrentDis->id) && $CurrentDis->id!='' && isset($CurrentDis->block_name) && $CurrentDis->block_name!=''){?>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->district_name);?></td>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->block_name);?></td>
<?}else{?>
<td align="left" style="color:black"><?=MyStripSlashes($CurrentDis->district);?></td>
<?}?>
<td align="center" style="color:black"><?=MyStripSlashes($bObj->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj2->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($bObj3->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj1->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj2->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj3->GetNumRows())?></td>
<td align="center" style="color:black"><?=MyStripSlashes($ImgObj4->GetNumRows())?></td>
</tr>
<?
$SNo++;
$Count++;
}
?>
</table>
<?
}
else
{
?>
<b>No Result Found.</b>
<?
}
break;
}
?>
答案 0 :(得分:0)
JavaScript可能违反了same-origin policy。
尝试将header('Access-Control-Allow-Origin: *');
添加到您希望提供JavaScript跨源访问的PHP页面,这样,当您尝试初始OPTIONS
请求时,您对跨源页面的Ajax请求将会看到它有权对其发出POST
或GET
请求。有关OPTIONS
请求如何运作的信息,请参阅CORS。
你也可以通过.htaccess这样做:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>