<?php

require_once '../../../../init.php';


 if($GLOBALS['_MAX']['CONF']['database']['type']=='mysql')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/mysql.php';
}
else if($GLOBALS['_MAX']['CONF']['database']['type']=='pgsql')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/pgsql.php';
}
else if($GLOBALS['_MAX']['CONF']['database']['type']=='mysqli')
{
require_once MAX_PATH . '/lib/OA/Dal/Delivery/mysqli.php';
}
// Required files
require_once MAX_PATH . '/lib/OA/Admin/Option.php';
require_once MAX_PATH . '/lib/OA/Admin/Settings.php';
require_once MAX_PATH . '/lib/OA/Creative/File.php';
require_once MAX_PATH . '/lib/max/Plugin/Translation.php';
require_once MAX_PATH . '/www/admin/config.php';


// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/lib/OA/Creative/File.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/max/other/common.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';

require_once LIB_PATH . '/Plugin/Component.php';


// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);

$table_prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
$oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel("Mobiledata Details");
phpAds_PageHeader('Mobile-os', $oHeaderModel);



?>


<div class="tableWrapper">
    <div class="tableHeader">

        <ul class='tableActions'>
 	 
              <li class='inactive activeIfSelected'>
	
              <a id='deleteSelection'  href="" class='inlineIcon disable'>Delete</a>

		<script type='text/javascript'>
                <!--
        
                $('#deleteSelection').click(function(event) {
                    event.preventDefault();
                   
                    if (!$(this).parents('li').hasClass('inactive')) {
                        var ids = [];
                        $(this).parents('.tableWrapper').find('.toggleSelection input:checked').each(function() {
                            ids.push(this.value);
                        });
                        window.location = 'os-delete.php?action=delete&aid=' + ids.join(',');
						
			
					   				                   
                    }
                });
                </script>
		
  
          	             
            </li>
  
              <li>
	
              <a href="os-edit.php?action=add&aid" >&nbsp;Add new Mobile data</a>    
             
  
          	             
            </li>        
            
        </ul>


        <div class="clear"></div>

        <div class="corner left"></div>
        <div class="corner right"></div>
    </div>

    <table cellspacing="0" summary="">
        <thead>
            <tr>

               <th class='first toggleAll'>
                  <input type='checkbox' />
                </th>

               
                <th>
                    <a href="#">Mobile OS</a>
                </th>
           <th>
                    <a href="#">Mobile Brand</a>
                </th>
                <th>
                    <a href="#">Mobile Model</a>
                </th>

                 <th >
                    <a href="#">Action</a>
                </th>
 	       <!--<th>  
		    <a href="#">Amount</a>
                </th>-->

 	       <th class="">  
                </th>

            </tr>
        </thead>

   <tbody>
<?php
$tempQuery= OA_Dal_Delivery_query("Select * FROM {$table_prefix}mobile ORDER BY `mobile_os` ASC");
$i =1;
if(OA_Dal_Delivery_numRows($tempQuery)>0)
{
while($row=OA_Dal_Delivery_fetchAssoc($tempQuery))
{	
if($i == 1) {	

		$_class = "odd hilite";

	} elseif($i%2 == 0) {

		$_class = "even";

	} else {

		$_class = "odd";

	}

?> 
<tr class="<?php echo $_class; ?>">
	        <td class='toggleSelection'>
                              <input type='checkbox' value="<?php print_r($row['mobile_id']);?>" />
                  </td>
		
		
	
 	<td>
		<a href="os-edit.php?aid=<?php echo $row['mobile_id'];?>&action=edit" class='inlineIcon iconAdx'><?php print_r($row['mobile_os']); ?></a>
	</td>
<td>
		<a href="os-edit.php?aid=<?php echo $row['mobile_id'];?>&action=edit" class='inlineIcon iconAdx'><?php print_r($row['mobile_brand']); ?></a>
	</td>

<td>
		<a href="os-edit.php?aid=<?php echo $row['mobile_id'];?>&action=edit" class='inlineIcon iconAdx'><?php print_r($row['mobile_model']); ?></a>
	</td>



 	
	<td>
		 <a  href="os-edit.php?aid=<?php echo $row['mobile_id'];?>&action=edit">Edit</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		 <a  href="os-delete.php?aid=<?php echo $row['mobile_id'];?>&action=delete">Delete</a> 
		
		
	</td>
	
	
					 


	<td class="alignRight verticalActions">
                    <ul class="rowActions"> <li></li></ul></td>

        </tr>
<?php 


	$i++;
}
}
else
{
?>
  <tr class='odd'>
                <td colspan='6'>&nbsp;</td>
            </tr>

            <tr class='even'>
                <td colspan='4' class="hasPanel">
                    <div class='tableMessage'>
                        <div class='panel'>
                                                            CURRENTLY THERE ARE NO MOBILEDATA AVAILABLE TO LIST
                            
                            <div class='corner top-left'></div>
                            <div class='corner top-right'></div>
                            <div class='corner bottom-left'></div>

                            <div class='corner bottom-right'></div>
                        </div>
                    </div>

                </td>
 			<td>&nbsp;</td>
 			</tr>
            </tr>
            <tr class='odd'>
                <td colspan='4'>&nbsp;</td>
 <td colspan='4'>&nbsp;</td>
            </tr>


<?php
}
?>
</tbody>
</table></div>


<?php

phpAds_PageFooter();

?>
