[svn r9956] cleanup

* lanuguage files
* coding standards
* ...
skala
Patrick Cool 19 years ago
parent 10f6a9737e
commit 60bc848265
  1. 578
      main/survey/create_new_survey.php

@ -32,44 +32,82 @@
*/ */
$langFile = 'survey'; $langFile = 'survey';
/*
-----------------------------------------------------------
Including necessary files
-----------------------------------------------------------
*/
require_once ('../inc/global.inc.php'); require_once ('../inc/global.inc.php');
//api_protect_admin_script();
require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php'); require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php"); require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php"); require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
/*
-----------------------------------------------------------
Table definitions
-----------------------------------------------------------
*/
$table_survey = Database :: get_course_table('survey');
$table_group = Database :: get_course_table('survey_group');
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course_survey_rel = Database :: get_main_table(MAIN_COURSE_SURVEY_TABLE);
/*
-----------------------------------------------------------
some permissions stuff (???)
-----------------------------------------------------------
*/
$status = surveymanager::get_status(); $status = surveymanager::get_status();
if($status==5) if($status==5)
{ {
api_protect_admin_script(); api_protect_admin_script();
} }
require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
/*
-----------------------------------------------------------
some language stuff
-----------------------------------------------------------
*/
// an api function for this would be nice since this is used in a lot of places in Dokeos
$MonthsLong = array(get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong")); $MonthsLong = array(get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
$tool_name = get_lang('CreateNewSurvey');
$tool_name1 = get_lang('Newsurvey');
$arr_date = explode("-",date("Y-m-d")); $arr_date = explode("-",date("Y-m-d"));
$curr_year = $arr_date[0]; $curr_year = $arr_date[0];
$curr_month = $arr_date[1]; $curr_month = $arr_date[1];
$curr_day = $arr_date[2]; $curr_day = $arr_date[2];
$coursePathWeb = api_get_path(WEB_COURSE_PATH);
$coursePathSys = api_get_path(SYS_COURSE_PATH);
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
//$cidReq = $_SESSION[_course][id]; //$cidReq = $_SESSION[_course][id];
$cidReq = $_GET['cidReq']; $cidReq = $_GET['cidReq'];
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_survey = Database :: get_course_table('survey');
$table_group = Database :: get_course_table('survey_group');
$table_course_survey_rel = Database :: get_main_table(MAIN_COURSE_SURVEY_TABLE);
$tool_name = get_lang('CreateNewSurvey');
$tool_name1 = get_lang('Newsurvey');
$page = $_REQUEST['page']; $page = $_REQUEST['page'];
$interbredcrump[] = array ("url" => "survey_list.php", "name" => get_lang('Survey'));
$course_id = $_SESSION['_course']['id']; $course_id = $_SESSION['_course']['id'];
$todate=date('j'); $todate=date('j');
/*
-----------------------------------------------------------
Breadcrumbs
-----------------------------------------------------------
*/
$interbreadcrumbs[] = array ("url" => "survey_list.php", "name" => get_lang('Survey'));
/*
-----------------------------------------------------------
-----------------------------------------------------------
*/
if($surveyid = $_REQUEST['surveyid']) if($surveyid = $_REQUEST['surveyid'])
{ {
if ($_POST['action'] == 'update_survey') if ($_POST['action'] == 'update_survey')
{ {
// @todo: replace the $_REQUEST by $_POST or $_GE
$cidReq=$_GET['cidReq']; $cidReq=$_GET['cidReq'];
$surveyid=$_REQUEST['surveyid']; $surveyid=$_REQUEST['surveyid'];
$surveycode=$_POST['survey_code']; $surveycode=$_POST['survey_code'];
@ -105,74 +143,74 @@ if ($_POST['action'] == 'update_survey')
header("location:survey_list.php?cidReq=$cidReq"); header("location:survey_list.php?cidReq=$cidReq");
exit; exit;
} }
} }
Display::display_header($tool_name); Display::display_header($tool_name);
api_display_tool_title($tool_name); api_display_tool_title($tool_name);
if( isset($error_message) ) if( isset($error_message) )
{ {
Display::display_error_message($error_message); Display::display_error_message($error_message);
} }
?> ?>
<SCRIPT LANGUAGE="JavaScript"> <SCRIPT LANGUAGE="JavaScript">
<!-- Begin <!-- Begin
function displayTemplate(form) { function displayTemplate(form) {
var inf = form.template.value; var inf = form.template.value;
if(inf=="") if(inf=="")
{ {
alert("Please Select a Template"); alert("Please Select a Template");
} }
else else
{ {
window.open(inf+".htm", 'popup', 'width=600,height=600,toolbar = no, status = no'); window.open(inf+".htm", 'popup', 'width=600,height=600,toolbar = no, status = no');
} }
//window.open(inf+".htm"); //window.open(inf+".htm");
//win.document.write("" + inf + ""); //win.document.write("" + inf + "");
} }
// End --> // End -->
</script> </script>
<script src=tbl_change.js type="text/javascript" language="javascript"></script> <script src=tbl_change.js type="text/javascript" language="javascript"></script>
<?php <?php
$sql = "select * from $table_survey where survey_id='$surveyid'"; $sql = "select * from $table_survey where survey_id='$surveyid'";
$res = api_sql_query($sql); $res = api_sql_query($sql);
$obj = mysql_fetch_object($res); $obj = mysql_fetch_object($res);
$arr_avail_from = explode("-",$obj->avail_from); $arr_avail_from = explode("-",$obj->avail_from);
$avail_year_from = $arr_avail_from['0']; $avail_year_from = $arr_avail_from['0'];
$avail_month_from = $arr_avail_from['1']; $avail_month_from = $arr_avail_from['1'];
$avail_day_from = $arr_avail_from['2']; $avail_day_from = $arr_avail_from['2'];
$arr_avail_till = explode("-",$obj->avail_till); $arr_avail_till = explode("-",$obj->avail_till);
$avail_year_till = $arr_avail_till['0']; $avail_year_till = $arr_avail_till['0'];
$avail_month_till = $arr_avail_till['1']; $avail_month_till = $arr_avail_till['1'];
$avail_day_till = $arr_avail_till['2']; $avail_day_till = $arr_avail_till['2'];
$template = $obj->template; $template = $obj->template;
?> ?>
<form name="new_calendar_item" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?cidReq=<?php echo $cidReq; ?>"> <form name="new_calendar_item" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?cidReq=<?php echo $cidReq; ?>">
<input type="hidden" name="surveyid" value="<?php echo $surveyid; ?>"> <input type="hidden" name="surveyid" value="<?php echo $surveyid; ?>" />
<input type="hidden" name="action" value="update_survey"> <input type="hidden" name="action" value="update_survey" />
<table> <table>
<tr> <tr>
<td><?php echo get_lang('surveycode'); ?></td> <td><?php echo get_lang('SurveyCode'); ?></td>
<td><input type="text" name="survey_code" size="20" maxlength="19" value="<?php echo $obj->code; ?>"></td> <td><input type="text" name="survey_code" size="20" maxlength="19" value="<?php echo $obj->code; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveytitle'); ?></td> <td><?php echo get_lang('SurveyTitle'); ?></td>
<td><input type="text" name="survey_title" size="40" maxlength="79" value="<?php echo $obj->title ?>"></td> <td><input type="text" name="survey_title" size="40" maxlength="79" value="<?php echo $obj->title ?>" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveysubtitle'); ?></td> <td><?php echo get_lang('SurveySubtitle'); ?></td>
<td><input type="text" name="survey_subtitle" size="40" maxlength="79" value="<?php echo $obj->subtitle ?>"></td> <td><input type="text" name="survey_subtitle" size="40" maxlength="79" value="<?php echo $obj->subtitle ?>" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('author'); ?></td> <td><?php echo get_lang('Author'); ?></td>
<td> <td>
<?php <?php
UserManager::get_teacher_list($cidReq,$obj->author); UserManager::get_teacher_list($cidReq,$obj->author);
?> ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveylanguage'); ?>&nbsp;</td> <td><?php echo get_lang('SurveyLanguage'); ?>&nbsp;</td>
<td> <td>
<select name="survey_language"> <select name="survey_language">
<option value="english" selected="selected">English</option> <option value="english" selected="selected">English</option>
@ -181,9 +219,9 @@ $template = $obj->template;
</select> </select>
</td> </td>
</tr> </tr>
<tr id="subtitle"> <tr>
<td><?php echo get_lang('availablefrom'); ?>&nbsp;</td> <td><?php echo get_lang('AvailableFrom'); ?>&nbsp;</td>
<td> <td>
<select name="fday"> <select name="fday">
<?php <?php
@ -200,8 +238,8 @@ $template = $obj->template;
?> ?>
</select> </select>
<!-- month: january -> <!-- month: january ->
december --> december -->
<select name="fmonth"> <select name="fmonth">
<? <?
for($i=1;$i<count($MonthsLong);$i++) for($i=1;$i<count($MonthsLong);$i++)
{ {
@ -215,22 +253,22 @@ december -->
echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n";
} }
?> ?>
</select> </select>
<select name="fyear"> <select name="fyear">
<?php <?php
for($i=$curr_year;$i<=$curr_year+10;$i++){ for($i=$curr_year;$i<=$curr_year+10;$i++){
if($i == $avail_year_from) if($i == $avail_year_from)
echo "<option value=\"$i\" selected>$i</option>\n"; echo "<option value=\"$i\" selected>$i</option>\n";
else else
echo "<option value=\"$i\">$i</option>\n"; echo "<option value=\"$i\">$i</option>\n";
} }
?> ?>
</select> </select>
<a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle"/></a></td> <a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" align="middle"/></a></td>
</tr> </tr>
<tr id="subtitle"> <tr>
<td><?php echo get_lang('availabletill'); ?>&nbsp;</td> <td><?php echo get_lang('AvailableTill'); ?>&nbsp;</td>
<td> <td>
<select name="end_fday"> <select name="end_fday">
<?php for($i=1;$i<=31;$i++){ <?php for($i=1;$i<=31;$i++){
@ -245,8 +283,8 @@ december -->
?> ?>
</select> </select>
<!-- month: january -> <!-- month: january ->
december --> december -->
<select name="end_fmonth"> <select name="end_fmonth">
<? <?
for($i=1;$i<count($MonthsLong);$i++) for($i=1;$i<count($MonthsLong);$i++)
{ {
@ -260,62 +298,73 @@ december -->
echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n";
} }
?> ?>
</select> </select>
<select name="end_fyear"> <select name="end_fyear">
<?php <?php
for($i=$curr_year;$i<=$curr_year+10;$i++){ for($i=$curr_year;$i<=$curr_year+10;$i++){
if($i == $avail_year_till) if($i == $avail_year_till)
echo "<option value=\"$i\" selected>$i</option>\n"; echo "<option value=\"$i\" selected>$i</option>\n";
else else
echo "<option value=\"$i\">$i</option>\n"; echo "<option value=\"$i\">$i</option>\n";
} }
?> ?>
</select> </select>
<a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle"/></a></td> <a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" align="middle"/></a></td>
</tr> </tr>
<tr> <tr>
<td valign="top"><?php echo get_lang('IsShareSurvey'); ?>&nbsp;</td> <td valign="top"><?php echo get_lang('IsShareSurvey'); ?>&nbsp;</td>
<td> <td>
<input type="radio" name="isshare" value="1" <?php if($obj->is_shared=='1') echo "checked";?>>Yes&nbsp;<input type="radio" name="isshare" value="0" <?php if($obj->is_shared=='0') echo "checked";?>>No <input type="radio" name="isshare" value="1" <?php if($obj->is_shared=='1') echo "checked";?> />Yes&nbsp;<input type="radio" name="isshare" value="0" <?php if($obj->is_shared=='0') echo "checked";?> />No
</td> </td>
</tr> </tr>
<tr><td valign="top"><?php echo get_lang('surveyintroduction'); ?>&nbsp;</td> <tr><td valign="top"><?php echo get_lang('SurveyIntroduction'); ?>&nbsp;</td>
<td> <td>
<?php <?php
api_disp_html_area('content',$obj->intro,'300px'); api_disp_html_area('content',$obj->intro,'300px');
?> ?>
<br> <br>
</td> </td>
</tr> </tr>
<tr><td valign="top"><?php echo get_lang('Thanks'); ?>&nbsp;</td> <tr><td valign="top"><?php echo get_lang('Thanks'); ?>&nbsp;</td>
<td> <td>
<?php <?php
api_disp_html_area('thanks',$obj->surveythanks,'200px'); api_disp_html_area('thanks',$obj->surveythanks,'200px');
?> ?>
<br> <br>
</td> </td>
</tr> </tr>
</table> </table>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" name="updateandreturn" value="<?php echo get_lang('saveandexit'); ?>"></td> <td><input type="submit" name="updateandreturn" value="<?php echo get_lang('SaveAndExit'); ?>" /></td>
<td><input type="submit" name="next" value="<?php echo get_lang('next'); ?>"></td> <td><input type="submit" name="next" value="<?php echo get_lang('Next'); ?>" /></td>
</tr> </tr>
</table> </table>
</form> </form>
</table> </table>
<?php <?php
} }
/*
-----------------------------------------------------------
-----------------------------------------------------------
*/
else else
{ {
if($_POST['back']) if($_POST['back'])
{ {
$cidReq=$_GET['cidReq']; $cidReq=$_GET['cidReq'];
header("location:survey.php?cidReq=$cidReq"); header("location:survey.php?cidReq=$cidReq");
exit; exit;
} }
if ($_POST['action'] == 'add_survey') /*
{ -----------------------------------------------------------
Action Handling
-----------------------------------------------------------
*/
if ($_POST['action'] == 'add_survey')
{
$surveycode=$_POST['survey_code']; $surveycode=$_POST['survey_code'];
$surveytitle = $_POST['survey_title']; $surveytitle = $_POST['survey_title'];
$surveysubtitle = $_POST['survey_subtitle']; $surveysubtitle = $_POST['survey_subtitle'];
@ -355,7 +404,7 @@ if ($_POST['action'] == 'add_survey')
if(!empty($result)) if(!empty($result))
{ {
$error_message=get_lang('thiscodealradyexist'); $error_message=get_lang('ThisCodeAlradyExist');
} }
else else
{ {
@ -376,205 +425,250 @@ if ($_POST['action'] == 'add_survey')
} }
} }
} }
} }
Display::display_header($tool_name);
api_display_tool_title($tool_name1); /*
//echo "<pre>"; -----------------------------------------------------------
//print_r($_SESSION); Display
//echo "</pre>"; -----------------------------------------------------------
if( isset($error_message) ) */
{ Display::display_header($tool_name);
api_display_tool_title($tool_name1);
if( isset($error_message) )
{
Display::display_error_message($error_message); Display::display_error_message($error_message);
} }
?> ?>
<SCRIPT LANGUAGE="JavaScript"> <SCRIPT LANGUAGE="JavaScript">
<!-- Begin <!-- Begin
function displayTemplate(form) { function displayTemplate(form) {
var inf = form.template.value; var inf = form.template.value;
if(inf=="") if(inf=="")
{ {
alert("Please Select a Template"); alert("Please Select a Template");
} }
else else
{ {
window.open(inf+".htm", 'popup', 'width=600,height=600,toolbar = no, status = no'); window.open(inf+".htm", 'popup', 'width=600,height=600,toolbar = no, status = no');
} }
//window.open(inf+".htm"); //window.open(inf+".htm");
//win.document.write("" + inf + ""); //win.document.write("" + inf + "");
} }
// End --> // End -->
</script> </script>
<script src=tbl_change.js type="text/javascript" language="javascript"></script> <script src=tbl_change.js type="text/javascript" language="javascript"></script>
<form name="new_calendar_item" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?cidReq=<?php echo $cidReq; ?>"> <form name="new_calendar_item" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?cidReq=<?php echo $cidReq; ?>">
<input type="hidden" name="action" value="add_survey"> <input type="hidden" name="action" value="add_survey" />
<input type="hidden" name="page" value="<?php echo $page; ?>"> <input type="hidden" name="page" value="<?php echo $page; ?>" />
<!--<input type="hidden" name="cidReq" value="<?php echo $cidReq; ?>">--> <!--<input type="hidden" name="cidReq" value="<?php echo $cidReq; ?>" />-->
<table> <table>
<tr> <tr>
<td><?php echo get_lang('surveycode'); ?></td> <td><?php echo get_lang('SurveyCode'); ?></td>
<td><input type="text" name="survey_code" size="20" value="<?php echo $surveycode; ?>" maxlength="19"></td> <td><input type="text" name="survey_code" size="20" value="<?php echo $surveycode; ?>" maxlength="19" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveytitle'); ?></td> <td><?php echo get_lang('SurveyTitle'); ?></td>
<td><input name="survey_title" type="text" value="<?php echo $surveytitle ?>" size="40" maxlength="79"></td> <td><input name="survey_title" type="text" value="<?php echo $surveytitle ?>" size="40" maxlength="79" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveysubtitle'); ?></td> <td><?php echo get_lang('SurveySubtitle'); ?></td>
<td><input name="survey_subtitle" type="text" value="<?php echo $surveysubtitle ?>" size="40" maxlength="79"></td> <td><input name="survey_subtitle" type="text" value="<?php echo $surveysubtitle ?>" size="40" maxlength="79" /></td>
</tr> </tr>
<tr> <tr>
<?php <?php
if($_SESSION['is_platformAdmin']=='1'||$_SESSION['is_courseAdmin']) if($_SESSION['is_platformAdmin']=='1'||$_SESSION['is_courseAdmin'])
{ {
echo "<td>"; echo "<td>";
echo get_lang('author'); echo get_lang('Author');
echo "</td>"; echo "</td>";
echo "<td>"; echo "<td>";
UserManager::get_teacher_list($course_id, $author_id); UserManager::get_teacher_list($course_id, $author_id);
echo "</td>"; echo "</td>";
} }
?> ?>
</tr> </tr>
<tr> <tr>
<td><?php echo get_lang('surveylanguage'); ?>&nbsp;</td> <td><?php echo get_lang('SurveyLanguage'); ?>&nbsp;</td>
<td> <td>
<select name="survey_language"> <select name="survey_language">
<option value="english" selected="selected">English</option> <option value="english" selected="selected">English</option>
<option value="french" >Fran&ccedil;ais</option> <option value="french" >Fran&ccedil;ais</option>
<option value="dutch" >Nederlands</option> <option value="dutch" >Nederlands</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr id="subtitle"> <tr>
<td><?php echo get_lang('availablefrom'); ?>&nbsp;</td> <td><?php echo get_lang('AvailableFrom'); ?>&nbsp;</td>
<td> <td>
<select name="fday"> <select name="fday">
<?php <?php
for($i=1;$i<=31;$i++){ for($i=1;$i<=31;$i++)
if($i<=9) $val = "0".$i; {
else $val = $i; if($i<=9)
if ($val==$curr_day) $selected = "selected"; {
else $selected = ""; $val = "0".$i;
}
else
{
$val = $i;
}
if ($val==$curr_day)
{
$selected = "selected";
}
else
{
$selected = "";
}
echo "<option value=\"$val\" $selected>$i</option>"; echo "<option value=\"$val\" $selected>$i</option>";
} }
?> ?>
</select> </select>
<!-- month: january -> <!-- month: january ->
december --> december -->
<select name="fmonth"> <select name="fmonth">
<? <?
for($i=1;$i<count($MonthsLong);$i++) for($i=1;$i<count($MonthsLong);$i++)
{ {
if($i<=9) if($i<=9)
{
$val = "0".$i; $val = "0".$i;
}
else else
{
$val = $i; $val = $i;
}
if($val == $curr_month) if($val == $curr_month)
{
echo "<option value=\"$val\" selected>".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\" selected>".$MonthsLong[$i-1]."</option>\n";
}
else else
{
echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n";
} }
?> }
</select> ?>
<select name="fyear"> </select>
<?php <select name="fyear">
for($i=$curr_year;$i<=$curr_year+10;$i++){ <?php
for($i=$curr_year;$i<=$curr_year+10;$i++)
{
if($i == $curr_year) if($i == $curr_year)
{
echo "<option value=\"$i\" selected>$i</option>\n"; echo "<option value=\"$i\" selected>$i</option>\n";
}
else else
{
echo "<option value=\"$i\">$i</option>\n"; echo "<option value=\"$i\">$i</option>\n";
} }
?> }
</select> ?>
<a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle"/></a></td> </select>
<a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'f')"><img src="../img/calendar_select.gif" border="0" align="middle"/></a></td>
</tr> </tr>
<tr id="subtitle"> <tr>
<td><?php echo get_lang('availabletill'); ?>&nbsp;</td> <td><?php echo get_lang('AvailableTill'); ?>&nbsp;</td>
<td> <td>
<select name="end_fday"> <select name="end_fday">
<?php for($i=1;$i<=31;$i++){ <?php
for($i=1;$i<=31;$i++)
{
if($i<=9) if($i<=9)
{
$val = "0".$i; $val = "0".$i;
}
else else
{
$val = $i; $val = $i;
if ($val==$curr_day) $selected = "selected"; }
else $selected = ""; if ($val==$curr_day)
{
$selected = "selected";
}
else
{
$selected = "";
}
echo "<option value=\"$val\" $selected>$i</option>"; echo "<option value=\"$val\" $selected>$i</option>";
} }
?> ?>
</select> </select>
<!-- month: january -> <!-- month: january ->
december --> december -->
<select name="end_fmonth"> <select name="end_fmonth">
<? <?
for($i=1;$i<count($MonthsLong);$i++) for($i=1;$i<count($MonthsLong);$i++)
{ {
if($i<=9) if($i<=9)
{
$val = "0".$i; $val = "0".$i;
}
else else
{
$val = $i; $val = $i;
}
if($val == $curr_month) if($val == $curr_month)
{
echo "<option value=\"$val\" selected>".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\" selected>".$MonthsLong[$i-1]."</option>\n";
}
else else
{
echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n"; echo "<option value=\"$val\">".$MonthsLong[$i-1]."</option>\n";
} }
?> }
</select> ?>
<select name="end_fyear"> </select>
<?php
for($i=$curr_year;$i<=$curr_year+10;$i++){ <select name="end_fyear">
<?php
for($i=$curr_year;$i<=$curr_year+10;$i++)
{
if($i == $curr_year+1) if($i == $curr_year+1)
{
echo "<option value=\"$i\" selected>$i</option>\n"; echo "<option value=\"$i\" selected>$i</option>\n";
}
else else
{
echo "<option value=\"$i\">$i</option>\n"; echo "<option value=\"$i\">$i</option>\n";
} }
?> }
</select>
<a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" align="absmiddle"/></a></td>
</tr>
<tr>
<td valign="top"><?php echo get_lang('IsShareSurvey'); ?>&nbsp;</td>
<td>
<input type="radio" name="isshare" value="1">Yes&nbsp;<input type="radio" name="isshare" value="0" checked>No
</td>
</tr>
<tr><td valign="top"><?php echo get_lang('surveyintroduction'); ?>&nbsp;</td>
<td>
<?php
api_disp_html_area('content',$content,'300px');
/*$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->BasePath = 'FCKeditor/';
$oFCKeditor->Value = 'Enter your introduction text here';
$oFCKeditor->Width = '600' ;
$oFCKeditor->Height = '400' ;
$oFCKeditor->Create();
*/
?> ?>
<br> </select>
</td> <a title="Calendar" href="javascript:openCalendar('new_calendar_item', 'end_f')"><img src="../img/calendar_select.gif" border="0" align="middle"/></a></td>
</tr> </tr>
<tr><td valign="top"><?php echo get_lang('Thanks'); ?>&nbsp;</td> <tr>
<td valign="top"><?php echo get_lang('IsShareSurvey'); ?>&nbsp;</td>
<td> <td>
<?php <input type="radio" name="isshare" value="1" />Yes&nbsp;<input type="radio" name="isshare" value="0" checked="checked" />No
api_disp_html_area('thanks',$thanks,'200px');
?>
<br>
</td> </td>
</tr> </tr>
<tr>
<td valign="top"><?php echo get_lang('SurveyIntroduction'); ?>&nbsp;</td>
<td><?php api_disp_html_area('content',$content); ?></td>
</tr>
<tr>
<td valign="top"><?php echo get_lang('Thanks'); ?>&nbsp;</td>
<td><?php api_disp_html_area('thanks',$thanks); ?></td>
</tr>
</table> </table>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type="submit" name="back" value="<?php echo get_lang('back'); ?>"></td> <td><input type="submit" name="back" value="<?php echo get_lang('Back'); ?>" /></td>
<td><input type="submit" name="saveandexit" value="<?php echo get_lang('createlater'); ?>"></td> <td><input type="submit" name="saveandexit" value="<?php echo get_lang('CreateLater'); ?>" /></td>
<td><input type="submit" name="next" value="<?php echo get_lang('next'); ?>"></td> <td><input type="submit" name="next" value="<?php echo get_lang('Next'); ?>" /></td>
</tr> </tr>
</table> </table>
</form> </table>
</table> </form>
<?php <?php
} }
/*
-----------------------------------------------------------
Footer
-----------------------------------------------------------
*/
Display :: display_footer(); Display :: display_footer();
?> ?>
Loading…
Cancel
Save