-
Notifications
You must be signed in to change notification settings - Fork 0
/
symptoms.php
556 lines (232 loc) · 10.7 KB
/
symptoms.php
1
<?phpif (session_id() == null || session_id() == "") { session_start();}require("config/config.php");include("admin/includes/phpfunction.php");?><!DOCTYPE html><html><head> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>MITSIM</title> <?php include("includes/maincss.php"); ?> <link href="css/profile.css" rel="stylesheet" type="text/css" /> <!-- Custom styles for this template --> <script src="js/jquery-1.3.0.min.js" type="text/javascript"></script> <?php include("includes/paginate.php"); ?></head><body><div class='backdiv'><div class='backl' style=""></div> <div class='backR' style=""></div></div><div style="" class='main-body-div'><div class="main"><?php include("includes/header_menu.php"); ?><div class="main-div"> <div class="sidebar" style="width:339px;"> <div class="main-nav"> <div class="menu"> <form method="get" action="#" id="sehfrm"> <input id="sh" name="sh" value="<?php if(isset($_GET['sh']) && $_GET['sh']!=""){echo $_GET['sh']; }?>" type="text" class="txtsearch" onblur="document.getElementById('sehfrm').submit();"/> <input id="sh" type="submit" style="width: 0px !important;visibility: hidden; height: 0px !important; border: none;"/> </form> </div> </div> <br> <br> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav side-nav"> <li> <a href="javascript:;" onclick="symptomsView('35','0')"><i class="fa fa-fw fa-leaf"></i> Birth Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('36','0')"><i class="fa fa-fw fa-leaf"></i> External Body Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('37','0')"><i class="fa fa-fw fa-leaf"></i> Internal Body Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('38','0')"><i class="fa fa-fw fa-leaf"></i> Blood Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('39','0')"><i class="fa fa-fw fa-leaf"></i> Eye Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('40','0')"><i class="fa fa-fw fa-leaf"></i> Nervous System Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('41','0')"><i class="fa fa-fw fa-leaf"></i> Bone Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('42','0')"><i class="fa fa-fw fa-leaf"></i> Dental Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('43','0')"><i class="fa fa-fw fa-leaf"></i> Skin Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('44','0')"><i class="fa fa-fw fa-leaf"></i> Genetic Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('45','0')"><i class="fa fa-fw fa-leaf"></i> Common Disease</a> </li> <li> <a href="javascript:;" onclick="symptomsView('46','0')"><i class="fa fa-fw fa-leaf"></i> Lack of Causes</a> </li> <li> <a href="javascript:;" onclick="symptomsView('47','0')"><i class="fa fa-fw fa-leaf"></i> Personalty Disorder</a> </li> </ul> </div> </div> <div class="div-profile-body-right" style="width:660px;" id="disp"> <?php $per_page = 20; if(isset($_GET['all'])) {$per_page = 10000;} $show_page =""; $sqlC="SELECT count(id) FROM `symptoms` where status='1'"; if(isset($_GET['sh']) && $_GET['sh']!="") { $_GET['sh']=" ".$_GET['sh']; $txt= $_GET['sh']; $sqlC = "SELECT count(id) FROM `symptoms` WHERE `status`='1' And MATCH (`name`, `description`) AGAINST ('".$txt."' IN BOOLEAN MODE);"; } //"SELECT count(id) FROM `symptoms` where status='1'" $count=mysql_fetch_array(mysql_query($sqlC)); $total_results =$count['0'] ; //289 if($total_results=="0"){ echo ' <div class="content" id="td_content"> <h1 style="color: #32789C;"> No Record Found !! </h1> </div> '; } $total_pages = ceil($total_results / $per_page); //29 if (isset($_GET['page'])) { $show_page = $_GET['page']; if ($show_page > 0 && $show_page <= $total_pages) { $start = ($show_page - 1) * $per_page; $end = $start + $per_page; } else { // error - show first set of results $start = 0; $end = $per_page; } } else { // if page isn't set, show first set of results $start = 0; $end = $per_page; //10 } $page = 0; if (isset($_GET['page'])) { $page = intval($_GET['page']); } $tpages = $total_pages; if ($page <= 0) { $page = 1; } $sqlC=""; if(isset($_GET['sh']) && $_GET['sh']!="") { $_GET['sh']=" ".$_GET['sh']; $txt= $_GET['sh']; $sqlC = "SELECT * FROM `symptoms` WHERE `status`='1' And MATCH (`name`, `description`) AGAINST ('".$txt."' IN BOOLEAN MODE) LIMIT 0 , 1000"; }else { $sqlC="SELECT * FROM `symptoms` where status='1' order By rand() LIMIT ".$start." , ". $per_page ; } $result = mysql_query($sqlC);$i=1; while($row=mysql_fetch_array($result)) { $i++; ?> <div class="content" id="1"> <div class="div-pic"><img src="images/temp.jpg" alt="" /></div> <div class="profile-nm"><?=$row['name'];?></div> <div class="div-pic-content"> <?=$row['description'];?> <!-- <a href="#">more</a>--> <div class="div-like"> <ul> <li id="likes<?=$i;?>"><a <?php if(isset($_SESSION['id']) && $_SESSION['id']!="") { $ro=getislike('symptoms',$row['id']); if($ro['id']!="") { echo 'href="javascript:" onclick="like(\'0\',\''.$row['id'].'\',\'symptoms\',\'likes'.$i.'\')" >Unlike</a>'; }else{ echo 'href="javascript:" onclick="like(\'1\',\''.$row['id'].'\',\'symptoms\',\'likes'.$i.'\')" >Like</a>'; } }else{ echo 'href="#login" data-toggle="modal" >Like</a>' ; } ?></li> <li id="recommend<?=$i;?>"><a <?php if(isset($_SESSION['id']) && $_SESSION['id']!="") { echo ' href="javascript:" onclick="emailmodal(\'symptoms\',\''.$row['id'].'\')">Recommend</a>'; }else{ echo ' href="#login" data-toggle="modal" >Recommend</a>' ; } ?></li> <li><a class="comment_button" <?php if(isset($_SESSION['id']) && $_SESSION['id']!="") { echo ' href="javascript:" onclick="showcommentbox(\'com'.$i.'\')" '; }else{ echo ' href="#login" data-toggle="modal" ' ; } ?> >Comment</a></li> </ul> </div> <div class="panel1" id="com<?=$i?>"> <div class="pnl-comment"> <div class="input-group"> <div class="div-box"><img src="images/temp1.jpg" alt="" /></div> <div class="comment-frm"> <form id="cfm<?=$i?>" method="post" action="#" onsubmit="return makecomment(<?=$i?>)" > <input class="form-control box" placeholder="Say something..." name="message" required="" id="message<?=$i?>"> <input type="hidden" id="id" name="id" value="<?=$row['id']?>"> <input type="hidden" id="type" name="type" value="symptoms"> <input id="bt<?=$i?>" type="submit" style="width: 0px !important; height: 0px !important; border: none;"/> </form> </div> </div> <div class="actionBox"> <ul class="commentList" id="clist<?=$i?>"> <?=getComment('symptoms',$row['id']);?> </ul> </div> </div> </div> </div> </div> <?php } ?> <?php $reload = $_SERVER['PHP_SELF'] . "?tpages=" . $tpages; echo '<div class="pagination"><ul>'; if ($total_pages > 1) { echo paginate($reload, $show_page, $total_pages); } ?> <!-- <li><a href="store.php?all=1"> All </a></li>--> <?php echo "</ul></div>"; ?> </div></div></div></div><?php include("includes/mainjs.php"); ?></body></html>