index.php 2.86 KB
Newer Older
majidbeigi's avatar
majidbeigi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
<?php

	include_once('../../library/config.php');

    $logadmin = new ADMIN();

    if(!$logadmin->logincheck()){
        header('location:../adminn/login/');
    }
    
    $db = new DB();
    $db->connect();
      
    
?>

<!DOCTYPE html>

<html>

<head>
        <?php
            include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');               
        ?>
    <script>
        $(function(){
          $("div.holder").jPages({
            containerID : "container",
            perPage:10
              });
            });
    </script>
</head>

<body>

<!-- Base Table -->

<table class="body" cellspacing="0" cellpadding="0" align="center">

    <!-- Head -->

    <?php

        include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');

    ?>

<tr>

    <!-- Main -->
    <td align="center" >
    <div id="main" align="center" class="ui-corner-all , ui-widget-content">

    <!-- Top Menu -->
    <?php
        include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
    ?>
        متولدین امروز
        <hr />

    <table dir="rtl" border="0"  cellpadding="6" cellspacing="0" style="width: 800px;">
    <tr>
        <td style="width: 40px;background: #C8E0E4;"> ردیف </td>
        <td style="width: 300px;background: #C8E0E4;"> نام و نام خانوادگی </td>
        <td style="width: 150px;background: #C8E0E4;"> موبایل </td>
        <td style="width: 100px;background: #C8E0E4;"> سن </td>
        <td style="width: 150px;background: #C8E0E4;"> تاریخ تولد </td>
    </tr>
    <tbody id="container">
    <?php
    $date = Date_new();
    
    $today = substr($date,5,5);
    
    $res = $db->select("lead"," birthday and mobile "," birthday desc");
    
    $i=0;
    $j=0;
    while(isset($res[$i]['id_lead']))
    {
        $y = substr($res[$i]['birthday'],5,5);
        
               
        if($y === $today)
        {
            $year1 = substr($res[$i]['birthday'],0,4);
            $year2 = substr($date,0,4);            
            $age = (intval($year2)-intval($year1))+1;
            
            if($age<61)
            {             
            print"<tr><td>".($j+1)."</td>";
            print"<td>".$res[$i]['name']." ".$res[$i]['family']."</td>";
            print"<td>".$res[$i]['mobile']."</td>";
            print"<td>".$age."</td>";
            print"<td>".Date_mTosh($res[$i]['birthday'])."</td></tr>";
            
            $j++;
            }
        }
        $i++;
    }
    ?>
    </tbody>
    </table>
    <div dir="ltr" class="holder"></div>
    <div>تعداد متولدین امروز <?php echo $j ?></div>
    </div>
    </td>
</tr>
<!-- Footer -->
        <?php
            include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
        ?>

</table>

</body>

</html>