<script type="text/javascript" src="date.js"></script>

<script type="text/javascript">
 public class Main 
{ public static void main(String[] args) {
 // هنا قمنا بتخزين الوقت الحالي للجهاز Date currentDate = new Date(); System.out.println( "Current Date: " + currentDate );
 // هنا أضفنا 5 ثواني على التاريخ 00:00:00 1/1/1970 Date specialDate = new Date(5000); System.out.println( "Special Date: " + specialDate ); } }
</script>
<!DOCTYPE html>
<html lang="en">
    <body>

        <?php
@header('Content-type: text/html;charset=windows-1256');
        $month = array("muhram" => "01",
            "safar" => "02",
            "rb1" => "03",
            "rb2" => "04",
            "jmad1" => "05",
            "jmad2" => "06",
            "rgeb" => "07",
            "shaaban" => "08",
            "rmdan" => "09",
            "shwal" => "10",
            "thogada" => "11",
            "thohga" => "12");
        ?>
        <form>
            <select name="month">
                <?php foreach ($month as $key => $value) { ?>
                    <option value="<?php echo $value; ?>">
                        <?php echo $key; ?>
                    </option>
                <?php } ?>
            </select>
            <input type="submit" name="submit">
        </form>
        <?php
        if (isset($_GET['month'])) {
  $inputMonth = $_GET['month'];
  
          
            $mkt = mktime(0, 0, 0, $inputMonth, 1, date("Y"));
            $date2 = date("Y-m-d", $mkt);
            $end2 = date("Y") . "-" . $inputMonth . "-" . date('t', strtotime($date2));
            ?>
            <table>
                <tr>
                    <?php
                    while (strtotime($date2) <= strtotime($end2)) {
                        $day_num = date('d', strtotime($date2));
                        $day_name = date('l', strtotime($date2));
                        $date2 = date("Y-m-d", strtotime("+1 day", strtotime($date2)));

                        echo "<td>$day_num <br/> $day_name</td>";
                    }

// end while 
                    ?>
                </tr>
            </table>
            <?php } 
include('functions_hijridate.php');
include("database/db_conection.php"); 
 $view_users_query=mysqli_query($dbcon,$view_users_query); 
//mysqli_query($dbcon, "SET NAMES 'latin1'") or die('Can\'t charset in DataBase');
 //$inputMonth = $_GET['month'];
    $view_users_query="select * from rafia_plan  where date='$inputMonth' ORDER BY name asc";
 $nums = mysql_num_rows($view_users_query);
//select query for viewing users.  
        $run=mysqli_query($dbcon,$view_users_query);
//here run the sql query.  
  
        while($row=mysqli_fetch_array($run))
//while look to fetch the result and store in a array $row.  
        {
$commentss=$row[comments];
$name=$row[name];
$date =$row[date];
$aa=hdate('_m');
$ee=hdate('_d');
if ($aa==$date and $ee==$name){
$commentss="<span style='color:red;'>$row[comments]</span>";}else {$commentss=$row[comments];}
echo  "<table width=55% cellpadding=2 cellspacing=0 border=0 class=tborder><tr class=alt2><td align=center><normalfont>Go</font></td><td align=center>$commentss</font></td></tr></table>";

}
//end if 
        ?>
    </body>
</html>