예제 #1
0
파일: rifsubmit.php 프로젝트: BBKolton/EXCO
					</div>
				</div>
			</div>
		<?php 
    }
    ?>

<?php 
}
//update rif items
if (isset($_POST['items']) || isset($_POST['serialized'])) {
    $parsed = array();
    parse_str($_POST['serialized'], $parsed);
    $_POST = array_merge($parsed, $_POST);
    unset($_POST['serialized']);
    saveItems();
    die;
}
function saveItems()
{
    $db = new DB();
    $items = $_POST['items'];
    foreach ($items as $item) {
        $rif = $db->select("SELECT rif_id FROM rifs_items WHERE id = " . $db->quote($item['id']))[0];
        if (verifyAdminOrRifInstructor($rif)) {
            $db->query("UPDATE rifs_items\n\t\t\t            SET name = " . $db->quote($item['name']) . " ,\n\t\t\t            cost = " . $db->quote($item['cost']) . " ,\n\t\t\t            quantity = " . $db->quote($item['quantity']) . " \n\t\t\t            WHERE id = " . $db->quote($item['id']));
        }
    }
    $db->query("UPDATE rifs \n\t            SET room_rate = " . $db->quote($_POST['room_rate']) . ", \n\t            room_hours = " . $db->quote($_POST['room_hours']) . ", \n\t            text_facilities = " . $db->quote($_POST['text_facilities']) . ", \n\t            fee_uw = " . $db->quote($_POST['fee_uw']) . ", \n\t            expected = " . $db->quote($_POST['expected']) . ",\n\t            loc_spec = " . $db->quote($_POST['loc_spec']) . ", \n\t            loc_gen = " . $db->quote($_POST['loc_gen']) . ",\n\t            fee_gen = " . $db->quote($_POST['fee_gen']) . " \n\t            WHERE id = " . $db->quote($_GET['id']));
    var_dump($_POST);
    die;
예제 #2
0
 } else {
     $smarty->assign('show_coordinates', $config->get("room", "show-coordinates"));
     $smarty->assign('rowindex', makeIndex($room['height'], $config->get("room", "y-axis-format")));
     $smarty->assign('columnindex', makeIndex($room['width'], $config->get("room", "x-axis-format")));
     switch ($mode) {
         case 'items':
             if (!$isallowed) {
                 break;
             }
             $smarty->assign('path', $template_dir . "/edit_items.tpl");
             $smarty->assign('mod_dir', $mod_dir);
             $breadcrumbs->addElement($room['title'], makeURL($mod, array('roomid' => $roomid)));
             $breadcrumbs->addElement($lang->get('edit_items'), makeURL($mod, array('roomid' => $roomid, 'mode' => 'items')));
             $smarty->assign('room', $room);
             if (isset($_POST['save'])) {
                 saveItems($room);
             }
             $items = $db->selectList($tbl_i, "*", "`roomid`=" . $roomid);
             $smarty->assign('items', $items);
             $matrix = makeItemMatrix($items, $room['height'], $room['width']);
             $smarty->assign('matrix', $matrix);
             $smarty->assign('typematrix', getTypeMatrix());
             $roomlist = $db->selectList($tbl_r, "*", 'eventid=' . $room['eventid']);
             $smarty->assign('roomlist', $roomlist);
             $smarty->assign('image_white', itemTypeToImage(0));
             break;
         case 'edit':
             if (!$isallowed) {
                 break;
             }
             $menu->addSubElement($mod, $lang->get('room_remove'), 'remove', array('roomid' => $roomid));