mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
updated admin panel files
added 'clockpicker' library (could replace jquerry-ui timepicker later on in some files) modified functions.display.php to handle external classes modified addrow-v2.js to display cloned values and init clockpicker
This commit is contained in:
@@ -1,135 +1,144 @@
|
||||
<?php
|
||||
/**
|
||||
* List and create availability groups
|
||||
*
|
||||
*
|
||||
* This file is part of queXS
|
||||
*
|
||||
* queXS is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* queXS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with queXS; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
||||
* @copyright Australian Consortium for Social and Political Research Inc (2011)
|
||||
* @package queXS
|
||||
* @subpackage admin
|
||||
* @link http://www.acspri.org.au/ queXS was writen for ACSPRI
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration file
|
||||
*/
|
||||
include("../config.inc.php");
|
||||
|
||||
/**
|
||||
* Database file
|
||||
*/
|
||||
include ("../db.inc.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
*/
|
||||
include("../functions/functions.xhtml.php");
|
||||
|
||||
/**
|
||||
* Display functions
|
||||
*/
|
||||
include("../functions/functions.display.php");
|
||||
|
||||
/**
|
||||
* Limesurvey functions
|
||||
*/
|
||||
include("../functions/functions.limesurvey.php");
|
||||
|
||||
/**
|
||||
* Operator functions
|
||||
*/
|
||||
include("../functions/functions.operator.php");
|
||||
|
||||
/**
|
||||
* Input functions
|
||||
*/
|
||||
include("../functions/functions.input.php");
|
||||
|
||||
global $db;
|
||||
|
||||
xhtml_head(T_("Time slots"),true,array("../css/table.css"),array("../js/window.js"));
|
||||
|
||||
if (isset($_POST['subdel']))
|
||||
{
|
||||
$availability_group = intval($_POST['availability_group']);
|
||||
|
||||
$db->StartTrans();
|
||||
|
||||
$sql = "DELETE FROM availability
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM questionnaire_availability
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM availability_group
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$db->CompleteTrans();
|
||||
}
|
||||
else if (isset($_POST['availability_group']))
|
||||
{
|
||||
$availability_group = $db->qstr($_POST['availability_group']);
|
||||
|
||||
$sql = "INSERT INTO `availability_group` (availability_group_id,description)
|
||||
VALUES (NULL,$availability_group)";
|
||||
|
||||
$db->Execute($sql);
|
||||
}
|
||||
|
||||
//view groups
|
||||
$sql = "SELECT description,
|
||||
CONCAT('<a href=\'availability.php?availability_group=', availability_group_id, '\'>". TQ_("Modify") . "</a>') as link
|
||||
FROM availability_group";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
print "<h3>" . T_("Time slots")."</h3>";
|
||||
|
||||
print "<p>" . T_("Time slots define periods of time during particular days of the week. These are used for the availability function and also the call attempt time slot function.") . "</p>";
|
||||
|
||||
if (empty($rs))
|
||||
print "<p>" . T_("No time slots") . "</p>";
|
||||
else
|
||||
xhtml_table($rs,array("description","link"),array(T_("Time slot"),T_("Modify")));
|
||||
|
||||
|
||||
//add an availablity group
|
||||
print "<h3>" . T_("Add time slot") . "</h3>";
|
||||
?>
|
||||
<form method="post" action="?">
|
||||
<p><label for="availability_group"><?php echo T_("Time slot name"); ?>: </label><input type="text" class="textclass" name="availability_group" id="availability_group"/></p>
|
||||
<p><input class="submitclass" type="submit" name="submit" value="<?php echo T_("Add time slot"); ?>"/>
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
xhtml_foot();
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* List and create availability groups
|
||||
*
|
||||
*
|
||||
* This file is part of queXS
|
||||
*
|
||||
* queXS is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* queXS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with queXS; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
* @author Adam Zammit <adam.zammit@acspri.org.au>
|
||||
* @copyright Australian Consortium for Social and Political Research Inc (2011)
|
||||
* @package queXS
|
||||
* @subpackage admin
|
||||
* @link http://www.acspri.org.au/ queXS was writen for ACSPRI
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration file
|
||||
*/
|
||||
include("../config.inc.php");
|
||||
|
||||
/**
|
||||
* Database file
|
||||
*/
|
||||
include ("../db.inc.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
*/
|
||||
include("../functions/functions.xhtml.php");
|
||||
|
||||
/**
|
||||
* Display functions
|
||||
*/
|
||||
include("../functions/functions.display.php");
|
||||
|
||||
/**
|
||||
* Limesurvey functions
|
||||
*/
|
||||
include("../functions/functions.limesurvey.php");
|
||||
|
||||
/**
|
||||
* Operator functions
|
||||
*/
|
||||
include("../functions/functions.operator.php");
|
||||
|
||||
/**
|
||||
* Input functions
|
||||
*/
|
||||
include("../functions/functions.input.php");
|
||||
|
||||
$css = array(
|
||||
"../include/bootstrap-3.3.2/css/bootstrap.min.css",
|
||||
"../css/custom.css"
|
||||
);
|
||||
$js_head = array(
|
||||
);
|
||||
$js_foot = array(
|
||||
"../js/window.js",
|
||||
"../js/custom.js"
|
||||
);
|
||||
global $db;
|
||||
|
||||
xhtml_head(T_("Time slots"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js")
|
||||
|
||||
if (isset($_POST['subdel']))
|
||||
{
|
||||
$availability_group = intval($_POST['availability_group']);
|
||||
|
||||
$db->StartTrans();
|
||||
|
||||
$sql = "DELETE FROM availability
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM questionnaire_availability
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM availability_group
|
||||
WHERE availability_group_id = $availability_group";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
$db->CompleteTrans();
|
||||
}
|
||||
else if (isset($_POST['availability_group']))
|
||||
{
|
||||
$availability_group = $db->qstr($_POST['availability_group']);
|
||||
|
||||
$sql = "INSERT INTO `availability_group` (availability_group_id,description)
|
||||
VALUES (NULL,$availability_group)";
|
||||
|
||||
$db->Execute($sql);
|
||||
}
|
||||
|
||||
//view groups
|
||||
$sql = "SELECT description,
|
||||
CONCAT('<a href=\'availability.php?availability_group=', availability_group_id, '\'>". TQ_("Modify") . "</a>') as link
|
||||
FROM availability_group";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
//print "<h3>" . T_("Time slots")."</h3>";
|
||||
|
||||
print "<div class='well'>" . T_("Time slots define periods of time during particular days of the week. These are used for the availability function and also the call attempt time slot function.") . "</div>";
|
||||
|
||||
if (empty($rs))
|
||||
print "<div class='alert alert-danger'>" . T_("No time slots") . "</div>";
|
||||
else{
|
||||
print "<div class='panel-body col-sm-4'>";
|
||||
// print "<h3>" . T_("Time slots")."</h3>";
|
||||
xhtml_table($rs,array("description","link"),array(T_("Time slot"),T_("Modify")));
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
//add an availablity group <label for="availability_group"><?php echo T_("Time slot name"); : </label>
|
||||
?>
|
||||
<div class=" panel-body col-sm-4"><form method="post" action="?">
|
||||
<h3><?php echo T_("Add time slot")," :";?></h3>
|
||||
<p><input type="text" class="textclass form-control" name="availability_group" id="availability_group" placeholder="<?php echo T_("Enter")," ",T_("new")," ",T_("Time slot name"); ?>"/></p>
|
||||
<p><input class="submitclass btn btn-default" type="submit" name="submit" value="<?php echo T_("Add time slot"); ?>"/></p>
|
||||
</form></div>
|
||||
<?php
|
||||
xhtml_foot($js_foot);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user