{config_load file="lang" section='crons'}

<div id="result_datas" style="display:none">
    <h1>{#cron_create_result#}</h1>
    <p id="all_is_ok" style="display:none;" class="success">{#result_cron_create_ok#}</p>
    <p id="err_req_url_missing" style="display:none;" class="error">{#error_cron_address_missing#}</p>
    <p id="err_req_url" style="display:none;" class="error">{#error_cron_address_format#}</p>
    <p id="err_req_frequency_missing" style="display:none;" class="error">{#error_cron_freq_missing#}</p>
    <p id="err_req_frequency" style="display:none;" class="error">{#error_cron_freq_format#}</p>
	<p id="err_first_start" style="display:none;" class="error">{#error_cron_first_start_format#}</p>
	<p id="err_not_reacheable" style="display:none;" class="error">{#error_cron_url_unreacheable#}</p>
	<p id="err_max_cronjobs_reached" style="display:none;" class="error">{#error_cron_max_reached#}</p>
	<p id="err_freq_too_small" style="display:none;" class="error">{#error_cron_freq_too_small#}</p>
</div>

<div id="form_new_cron_container">
	<h1>{#cron_create#}</h1>
	<p>{#cron_create_intro#}</p>
	<p>{#cron_create_helpmsg#}</p>
	<form id="form_new_cron" name="form_new_cron" action="">
		<table>
			<tr>
				<td>{#cron_task_url#} :</td>
				<td colspan="2" ><input type="text" name="req_url" id="req_url" /></td>
			</tr>
			<tr>
				<td>{#cron_task_activation#} :</td>
				<td colspan="2">
					<select name="active" id="active">
						<option value="true" selected="selected">{#_yes#|capitalize}</option>
						<option value="false">{#_no#|capitalize}</option>
					</select>
				</td>
			</tr>
			<tr>
				<td id="form_freq" title="{#cron_frequency_title#} {$CRON_MIN_TIME/60} {#minutes#}">{#cron_task_frequency#} :</td>
				<td><input type="text" name="req_frequency" id="req_frequency" /></td>
				<td>
					<select name="freq_unit" id="freq_unit">
						<option value="0">{#minutes#}</option>
						<option value="1">{#hours#}</option>
						<option value="2">{#days#}</option>
						<option value="3">{#weeks#}</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>{#cron_task_first_exec#} :</td>
				<td><input type="text" name="first_start" id="first_start" value="0"/></td>
				<td>
					<select name="first_start_unit" id="first_start_unit">
						<option value="0">{#minutes#}</option>
						<option value="1">{#hours#}</option>
						<option value="2">{#days#}</option>
						<option value="3">{#weeks#}</option>
					</select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td colspan="3"><input type="button" value="{#btn_new_cron#}" onclick="validateForm('form_new_cron',1);" /></td>
			</tr>
		</table>
	</form>
</div>