File: /home/imensosw/public_html/imenso.co/demo/claapp/manager/csv.php
<?php
if(isset($_POST['keyword']) && !empty($_POST['keyword']) && !empty($_POST['type'])){
$codeype=array("Dx-Primary"=>'dCodesPrimary',"Dx-Secondary"=>"dCodesSecondary","PCS-Primary"=>"pCodesPrimary","PCS-Secondary"=>"pCodesSecondary","CPT"=>"cpt");
$codeype=array("dCodesPrimary"=>'Dx-Primary',"dCodesSecondary"=>"Dx-Secondary","pCodesPrimary"=>"PCS-Primary","pCodesSecondary"=>"PCS-Secondary","cpt"=>"CPT");
$ch = fopen("../CLA.csv", "r");
$result=array(); $flag=0;
/* This will loop through all the rows until it reaches the end */
while(($row = fgetcsv($ch)) !== FALSE) {
$test=$row[1]; $test1=$row[0];
if($test1==$codeype[$_POST['type']] && stripos($test, $_POST['keyword']) !== false)
{
if($flag==0)
{
echo '<ul id="suggesstion-list" tabindex="-1">';
}
if($flag>4)
{
break;
}
$flag++;
?>
<li data-code='<?php echo $row[1]; ?>' tabindex="<?php echo $flag ?>" data-dis='<?php echo $row[2]; ?>' class="list_code_dis"><?php echo $row[1]; ?></li>
<?php
}
}
if($flag>0){
echo '</ul>';
}
}
else if(isset($_POST['keyword_tag']) && !empty($_POST['keyword_tag'])){
$ch = fopen("../CLA-Tags.csv", "r");
$result=array(); $flag=0;
/* This will loop through all the rows until it reaches the end */
while(($row = fgetcsv($ch)) !== FALSE) {
$test = $row[0];
if(stripos($test, $_POST['keyword_tag']) !== false)
{
if($flag==0)
{
echo '<ul id="suggesstion-list">';
}
if($flag>4)
{
break;
}
$flag++;
?>
<li data-tag='<?php echo $row[0]; ?>' class="list_tag"><?php echo $row[0]; ?></li>
<?php
}
}
if($flag>0){
echo '</ul>';
}
}
?>