<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

if( !defined('CONFIXX') ) 
{
	return;
}


$jobs = $crn->getEntryList();

include_once("../include/page_functions.php");
?>
<script>
<?
echo js_f_call_help('cron_desc_title', 'cron_desc1');
?>
function new_job()
{
	document.location = "tools_cron.php?new_job=1";
}

function read_jobs()
{
	document.location = "tools_cron.php?read_jobs=1";
}

function edit_job(key)
{
	document.location = "tools_cron.php?edit=" + key;
}

function delete_job(key)
{
<? 
	echo js_f_confirm(ltext('cron_delete_quest'), 'return ;');
?>
	document.location = "tools_cron.php?delete=" + key;
}

</script>
<table class="tblbgcolor" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
	<td class="titel-3" ><? echo $vars["minute"]; ?></td>
	<td class="titel-3" ><? echo $vars["hour"]; ?></td>
	<td class="titel-3" ><? echo $vars["dom"]; ?></td>
	<td class="titel-3" ><? echo $vars["month"]; ?></td>
	<td class="titel-3" ><? echo $vars["dow"]; ?></td>
	<td class="titel-3" ><? echo $vars["cmd"]; ?></td>
	<td class="titel-3" >&nbsp;</td>
</tr>
<? if(is_array($jobs) && sizeof($jobs)): foreach ($jobs as $j): if(!$j->isRemoved()): $key = base64_encode($j->getString()); ?>
<tr>
	<td><? echo $j->getValue("minute"); ?></td>
	<td><? echo $j->getValue("hour"); ?></td>
	<td><? echo $j->getValue("dom"); ?></td>
	<td><? echo $j->getValue("month"); ?></td>
	<td><? echo $j->getValue("dow"); ?></td>
	<td><? echo htmlspecialchars($j->getValue("cmd")); ?></td>
	<td><a class="data" href="javascript: edit_job('<?=$key?>')"><? echo ltext("cron_edit"); ?></a> / <a class="data" href="javascript: delete_job('<?=$key?>')"><? echo ltext("cron_delete"); ?></a></td>
</tr>
<? endif; endforeach; endif; ?>
<tr>
	<td colspan="7"><?=std_button(ltext('cron_new_job'), "javascript: new_job()")?></td>
</tr>
</table>

<table  border="0" cellspacing="0" cellpadding="2" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" width="100%">
<tr>
	<td><?=std_button(ltext('cron_reread'), "javascript: read_jobs()")?></td>
</tr>
</table>
