<?php
include_once("../include/main.inc.php");

check_session('MyCpanel','index.php');

################ Paging Starts From Here ##################

@extract($_REQUEST);
$start = (intval($start)==0 or $start=="")?$start=0:$start;
$pagesize = intval($pagesize)==0?$pagesize=100:$pagesize;
if($parentID=="") {
	$parentID=0;
}
$heading="Manage Collaboration Enquiry";
$record_type="Enquiry";
$script_name="manage_collaboration_enquiry.php";
$table_name="colaboration_tbl";
if($id=="delete_record") {
	db_query("delete from $table_name where id='$catID'");
	$_SESSION[session_message]=$record_type.' has been deleted successfully';
	header("Location: ".SITE_ADMIN_URL."/".$script_name."?start=".$start."&parentID=".$parentID."&catID=".$catID."&pagesize=".$pagesize);
	exit;	 
}
admin_header("Manage $record_type");	
?>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
 <tr>
	<td align="left" width="50%" class="myTitle"><?=$heading;?></td>
	<td align="right">
	 <form name="pagesize_form" action="<?=$PHP_SELF?>" method="post" style="margin:0px;padding:0px;">
	 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
	  <tr>
	   <td align="right">Records Per Page:
	    <select name="pagesize" onchange="this.form.submit();">
	     <option value="0">Select</option>
	     <?php
	     foreach($_GLOBALS[pgsize_arr] as $val) {
		     if(trim($pagesize)==trim($val)) {
			     echo '<option value="'.$val.'" selected>'.$val.'</option>';
		     }
		     else{
			     echo '<option value="'.$val.'">'.$val.'</option>';
		     }
	     }
	     ?>
	    </select>
	    <input type="hidden" name="catID" value="<?=$locationID;?>">
	    <input type="hidden" name="parentID" value="<?=$parentID;?>">
		 </td>
		</tr>
	 </table>
	 </form>
	</td>
</tr>
</table>
<hr size="2" width="99%" color="#DA251C">

<!-- ##################Enquiry Search Option################### -->
<form name="srch" method="post" action="" style="display:inline" enctype="multipart/form-data">
<table width="100%"  border="0" cellpadding="0" cellspacing="2">
 <tr>
 <td align="right"><b>Search Location </b> [by name, country, comment etc.] :-
  <input type="text" name="keyword" value="" size="40">
  <input type="submit" class="button" value="GO">   
 </td>
</table>
</form>
<?php
$cond="";
if (strlen($keyword)) {
	?>
	<br/>
	<div style="width:99%;">
	 <div style="float:left;"><strong>Search For :</strong> <?=$keyword;?></div>
	 <div style="float:right;"><a href="javascript:history.go(-1);"><strong>Go Back</strong></a></div>
	</div> 
	<?php
	$cond=" (name like '%$keyword%' or location like '%$keyword%')";
	$qry= db_query("select * from $table_name where $cond order by id desc limit $start, $pagesize");
}else{
	$qry= db_query("select * from $table_name order by id desc limit $start, $pagesize");
}
$qry1= db_query("select * from $table_name ");
$reccnt = NumRows($qry);
echo pageNavigation($reccnt,$pagesize,$start);
print_message();
?>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
 <tr>
  <td>
   <?php
   if($parentID!="" && $parentID!=0) {
   ?>
   <a href="manage_enquiry.php">Manage Enquiry</a> 
	<?php
   }
   ?>
  </td>
 </tr>
</table><br />
<form name="formn" method="post" action="" enctype="multipart/form-data">
<table width="100%"  border="0" cellpadding="2" cellspacing="2" class="lightBorder">
 <?php if($reccnt>0) { ?>
 <tr bgcolor="#EAEAEA">
 <td width="3%"><input type="checkbox" name="chk" onclick="CheckAll()" class="NoStyle"></td>
  <td width="10%" height="20" align="left"><strong>S.No.</strong></td>
  <td colspan='2' width="40%" align="left"><strong>Sender Detail </strong></td>
 <!-- <td width="40%" align="center"><strong>Enquiry Details</strong></td> -->
 <td width="40%" align="center"><strong>Uploaded CV</strong></td>
 <td width="10%" align="center"><strong>Receive Date</strong></td>
  <td width="15%" align="left"><strong>Options</strong></td>
</tr>
 <?php
 $sl=$start+1;
while($arr=mysql_fetch_array($qry)) {
 $arr=ms_htmlentities_decode($arr);
	 if($sl%2!=0) {
		 $color="#f9f9f9";
	 }
	 else{
		 $color="#f0f0f0";
	 }
	 

?>
	 <tr  bgcolor="<?=$color;?>">
	 <td class="<?=$class?>" valign="top"><input type=checkbox name="cid[]" value="<?=$arr['locationID'];?>" class="NoStyle"></td>
	 <td align="left"><?=$sl;?>.</td>
	 <td align="left" class="<?=$class?>">
 Name: <b><?=$arr['name'];?></b> <br /> 
 Email: <b><?=$arr['email'];?></b>  <br />
 Mobile: <b><?=$arr['en_mobile'];?></b>  <br />
 Country: <b><?=$arr['location'];?></b>  
 Address: <b><?=$arr['address'];?></b>  
 </td>
	 <td align="left" class="<?=$class?>">
  Specialization: <b><?=$arr['specialisation'];?></b>  <br /> 
  Experience: <b><?=$arr['experience'];?></b>  <br /> 
  Qualification: <b><?=$arr['qualification'];?></b>  <br /> 
  URL: <b><?=$arr['url'];?></b> <br /> 
  IP Address: <b><?=$arr['ip'];?></b>  <br /> 
	  </td>
	  <td>
	  	<?php
		   if($arr[cv_file]!="") {
			   
				   ?>
				   <a href="<?= SITE_URL_PATH ?>/uploaded-files/cv/<?= $arr[cv_file] ?>" class="linkgray fontbold"><strong>Download CV<strong></a>
				   <?php
			   
		   }
		   else {
			   ?>
<strong>No Image Uploaded</strong>
			   <?php
		   }
		   ?>
	  </td>
	   <td align="left" class="<?=$class?>">
 <b><?=$arr['enquiry_date'];?></b>  
	  </td>
	  <td class="<?=$class?>" align="left">
	   &nbsp;<a href="<?=SITE_ADMIN_URL?>/<?=$script_name;?>?id=delete_record&start=<?=$start;?>&catID=<?=$arr[id];?>&parentID=<?=$parentID;?>&pagesize=<?=$pagesize;?>" onClick="return confirm('Are you sure to delete this <?=$record_type;?>...');"><img src="<?=SITE_ADMIN_URL?>/images/cancel.gif" alt="Delete This <?=$record_type;?>" title="Delete This <?=$record_type;?>" border="0"></a>
	  </td>
	 </tr>
 <?php
 $sl++;
 }
?>
 <tr>
<?php } else{ ?>
<tr><td><b>No Record Found........</b></td></tr>
 <?php } ?>
</table>
</form><br/>

<?php











admin_footer();







exit;







?>