<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
global $configverssion_id; global $configapp_version; global $configversion_lastupdate; global $configversion_date; global $userID; global $server; global $LANG; $resellerID = getReseller();
//=== List page stuffs =============
$page = 1; $setLimit = 30;
if(isset($_GET["page"])) $page = (int)$_GET["page"];
$pageLimit = ($page * $setLimit) - $setLimit; 
$pageurl=$_SERVER['REQUEST_URI']."?";
if(count($_GET)) { $pageurl = $_SERVER['REQUEST_URI'].'&'; }
$trans = array("s=d_o" => "", "s=d_n" => "", "s=r_h" => "", "s=r_l" => "", "s=s_r" => "", "s=s_u" => "", "s=s_q" => "", "s=s_c" => "", "s=s_f" => "", "s=s_p" => "");
$pageurl = strtr($pageurl,$trans);
$pageurl = str_replace('&&','&',$pageurl);
//====End ==============
define('TITLE','Information');
if(userRole()>1) {
	header('location: index.php');	
}
$today = date('Y-m-d'); $time = strtotime($today.'-1 months'); $lastMonth = date("Y-m", $time); $time = strtotime($today.'-1 years'); $lastYear = date("Y", $time);
?>
<?php
?>

<div class="row no-m-t no-m-b">
 	<div class="col s12 m12 l12">
        <div class="card blue">
            <div class="card-content white-text"><?=$LANG['The system information page gives you some important information about your Sendroid as well as server.<br>This may come handy while troubleshooting']?></div>
        </div>
    </div>
 </div>
 
 <div class="row no-m-t no-m-b">
 
     <div class="col s12 m6 l5">
         <div class="card card-white">   
            <div class="card-content">
            	 <div class="card-title"><i class="material-icons">info</i> <?=$LANG['Product Information']?></div>
                 <h5>Sendroid Ultimate</h5>
            	<table class="highlight responsive2-table">
                	<tbody>

                        <tr class="">
                            <td><b><?=$LANG['Version']?></b></td>
                            <td><?=$configapp_version?></td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Release No.']?></b></td>
                            <td><?=$configverssion_id?></td>
                        </tr>
                         <tr class="">
                            <td><b><?=$LANG['Release Date']?></b></td>
                            <td><?=$configversion_date?></td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Last Update']?></b></td>
                            <td><?=$configversion_lastupdate?></td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['License']?></b></td>
                            <td><?=@LICENSE_TYPE?> License</td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Product Key']?></b></td>
                            <td><?=LICENSE?></td>
                        </tr> 
                    </tbody>
                </table>
                 <a class="btn waves-effect waves-light green darken-4" href="#" onclick="addPB();"><i class="fa fa-pencil"></i> <?=$LANG['Update License']?></a> 
            </div>
         </div> 
         
     </div>           

    <div class="col s12 m6 l7">
        <div class="card card-white">   
            <div class="card-content">
            	 <div class="card-title"><i class="material-icons">contact_phone</i> <?=$LANG['System Information']?></div>
            	<table class="highlight responsive2-table">
                	<tbody>
                    	<tr class="">
                			<td><b><?=$LANG['PHP Version']?></b></td>
                            <td><?=PHP_VERSION?></td>        	
                        </tr>
                        <tr class="">
                			<td><b><?=$LANG['MySQL Version']?></b></td>
                            <td><?=mysqli_get_server_info($server);?></td>        	
                        </tr> 
                        <tr class="">
                			<td><b><?=$LANG['Server Software']?></b></td>
                            <td><?=$_SERVER['SERVER_SOFTWARE']?></td>        	
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Install Directory']?></b></td>
                            <td><?=str_replace('/system/','',BASEPATH)?></td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Minute Cron Status']?></b></td>
                            <td><?=minuteCronStat()?></td>
                        </tr>
                        <tr class="">
                            <td><b><?=$LANG['Hour Cron Status']?></b></td>
                            <td><?=hourCronStat()?></td>
                        </tr>
                    </tbody>
                </table>
            </div>
         </div> 
         
</div>
 
 <div id="add_new" style="display: none;overflow-x: hidden; width: 99.99%; height: 99.99%; z-index: 1000; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.7);">
   	 <div class="row"><br><br>
       	<div class="col s1 m2 l3"> </div>
           <div class="col s10 m8 l6 white"> 
             <h5><?=$LANG['Update License']?> <span class="right"><a href="#" class="red-text" onclick="$('#add_contact')[0].reset();$('#add_new').hide('slow');"><i class="fa fa-times"></i></a></span></h5>
            
             <div class="card ">
                 <form action="info" method="post" id="add_contact"  onSubmit="return false;">
                 <div class="card-content">
                        <div class="row no-m-t no-m-b">
                             <div class="input-field col s12">
                                   <input id="license" type="text" required class="validate">
                                   <label for="license"><?=$LANG['New License Key']?></label>
                             </div>
                       	</div>
                 </div>   
                 <div class="card-action">
                     <button id="lic-button" class="btn green darken-4" type="submit"><?=$LANG['Update License']?> </button>
                     <span id="lic-spin" class="btn-flat" style="display: none;"><i class="fa fa-spinner fa-spin"></i> <strong><?=$LANG['Please wait']?>...</strong></span>
                     <a class="btn waves-effect waves-light red" href="#" onclick="$('#add_contact')[0].reset();$('#add_new').hide('slow');"><?=$LANG['Cancel']?></a>
                 </div>
                 </form>
             </div>
           </div>
       <div class="col s1 m2 l3"> </div>
	 </div>
 </div>          
 </div>
