0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ED
/
[
Home
]
File: projectreport_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; @$_SESSION['sl_no'] = 0; ?> <style type="text/css"> <!-- .style2 {font-weight: bold} .style3 { font-size: 16px; font-weight: bold; } .style4 { color: #FF0000; font-weight: bold; } .style5 { font-size: 18px; font-weight: bold; } --> </style> <?php $error_flag=0; $u_name= @$_SESSION['username']; $sql="select user_name from user where user_name!='$u_name'"; $sql=mysql_query($sql); $i=0; $u_name_array[$i]="All"; while($row=mysql_fetch_array($sql)) { $u_name_db=$row['user_name']; $i=$i+1; $u_name_array[$i]=$u_name_db; } if(isset($_POST['Submit'])) { // 2 $year =$_POST['date_current']; $division_combo= @$_POST['cmbdivision'] ; $division_name=$u_name_array[$division_combo]; if ( $division_name != "All") { $sql="select user_id from user where user_name='$division_name'"; $sql=mysql_query($sql); while($row=mysql_fetch_array($sql)) { $u_id=$row['user_id']; } } else { $u_id =0; } // if ( @$_POST['date_current'] != "") // { // if (!is_numeric(@$_POST['date_current'])) // { // $error['date_current']="Invalid date"; // $error_flag=1; // } // if (strlen(@$_POST['date_current']) < 4) // { // $error['date_current']="Invalid date"; // $error_flag=1; // } // } if($error_flag==1) { // 1 include "projectreport.php"; exit(); } else { // 1 ?> <div align="center"> <div align="center"> <p><strong><span class="style3"> CWRDM Calicut </span></strong></p> <span class="style5">Project Details </span></div> <p> <?php @$_SESSION['sl_no']= 0; $abc = @$_POST['date_current']; $string = explode('-',$abc); $date1 = explode('/',$string[0]); $date2 = explode('/',$string[1]); $from_date = $date1[2].'-'.$date1[0].'-'.$date1[1]; $to_date = $date2[2].'-'.$date2[0].'-'.$date2[1]; if ($u_id == 0 ) // all division { //3 if (@$_POST['date_current'] == "") { $sql="select * from addproject ORDER BY project_title"; } else { // $sql="select * from addproject where $year between YEAR(startdate) and YEAR(end_date) ORDER BY project_title"; $sql = "SELECT * FROM addproject WHERE startdate >= '" . $from_date . "' AND startdate <= '" . $to_date . "' ORDER BY project_title"; } }//3 else { //3 if (@$_POST['txtyear'] == "") { $sql="select * from addproject where user_id='$u_id' ORDER BY project_title"; } else { // $sql="select * from addproject where user_id='$u_id' and $year between YEAR(startdate) and YEAR(end_date) ORDER BY project_title"; $sql = "SELECT * FROM addproject WHERE user_id='$u_id' AND startdate >= '" . $from_date . "' AND startdate <= '" . $to_date . "' ORDER BY project_title"; } } //3 //echo $sql_budget; ledgerreport::printledgerDetails($sql,$from_date,$to_date,$division_name,$fund_array); } // 1 } // 2 class ledgerreport { //7 public static function printledgerDetails($sql1,$from_date,$to_date,$division_name,$fund_array) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 //echo "By Account:$byaccount"; ?> </p> <table width="343" border="0"> <tr> <td width="101"><strong>Division</strong></td> <td width="232"><span class="style4">: <?php echo $division_name; ?> </span></td> </tr> <tr> <td><strong>Date</strong></td> <td><span class="style4">: <?php if($from_date ==""){echo "All";}else{ echo "$from_date - $to_date";} ?> </span></td> </tr> </table> <table width="1510" height="83" border="1" align="center" bordercolor="#CC0000"> <tr bgcolor="#853008"> <th width="35"><font color="#F4E7BD"> S No </font></th> <th width="85"><font color="#F4E7BD">Project code</font></th> <th width="219"><font color="#F4E7BD"> Project Title</font></th> <th width="105"><font color="#F4E7BD">Princilple Investigator</font></th> <th width="111"><font color="#F4E7BD">Investigators</font></th> <th width="97"><font color="#F4E7BD">FundAgency</font></th> <th width="59"><font color="#F4E7BD">Fund Type</font></th> <th width="59"><font color="#F4E7BD">Duration</font></th> <th width="63"><font color="#F4E7BD">Start date</font></th> <th width="63"><font color="#F4E7BD">End date</font></th> <th width="254"><font color="#F4E7BD">Abstract</font></th> <th width="220"><font color="#F4E7BD">Objective</font></th> <th width="58"><font color="#F4E7BD">Project Proposel</font></th> </tr> <tr><?php while($row=mysql_fetch_array($sql)) {//32 ?> <th height="52"><?php @$_SESSION['sl_no']=@$_SESSION['sl_no']+1; echo @$_SESSION['sl_no']; ?></th> <th><?php echo $row['project_code']; ?></a></th> <th><?php echo $row['project_title']; ?></th> <th><?php $pinvestigator=$row['principle_investigator']; $sql_pi="select name from pi where pi_id='$pinvestigator'"; $sql_pi=mysql_query($sql_pi); while($row_pi=mysql_fetch_array($sql_pi)) { $pinvestigator=$row_pi['name']; } echo $pinvestigator; ?></th> <th><?php echo $row['investigators']; ?></th> <th><?php echo $row['fundagency']; ?></th> <th><?php $fund_type=$row['fundtype']; echo $fund_array[$fund_type]; ?></th> <th><?php echo $row['duration']; ?></th> <th><?php echo $row['startdate']; ?></th> <th><?php echo $row['end_date']; ?></th> <th><?php echo $row['abstract']; ?></th> <th><?php echo $row['objective']; ?></th> <th><a href= "<?php echo "../Proposels/".$row['projectproposel'];?>" ><img src="../images/white_download.png" alt="download" width="44" height="44" /></a></th> </tr> <?php }//32 }// 14 else { echo "No Data Found"; } ?> </table> <blockquote> <p><a href="#" class="projectboldtxt style2" onclick="window.print()">Print</a> <a href="projectreport.php">Back</a></p> </blockquote> <?php }//10 } //7 ?>