Esempio n. 1
0
function update_action()
{
    update_row();
    $rows = get_all_rows();
    $html = render_template("view/admin.php", array('rows' => $rows));
    return $html;
}
Esempio n. 2
0
switch ($_POST['action']) {
    case 'add':
        #Function for add row
        add_row($connection, $table);
        break;
    case 'delete':
        #Function for delete row
        del_row($connection, $table, $_GET['id']);
        break;
    case 'edit':
        #Function for edit form
        print_update_page($connection, $table, $_GET['id']);
        exit;
    case 'update':
        #Function for update row
        update_row($connection, $table);
        break;
    default:
        break;
}
#Function for print table
print_income($connection, $from, $step, $url);
?>
		

		<div class="page_list">

			<?php 
#Вывод списка страниц
print_pages_list($connection, $table, $step, $url);
?>
Esempio n. 3
0
header("Content-type: text/xml");
//encoding may differ in your case
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
//output update results
echo "<data>";
$ids = explode(",", $_POST["ids"]);
//for each row
for ($i = 0; $i < sizeof($ids); $i++) {
    $rowId = $ids[$i];
    //id or row which was updated
    $newId = $rowId;
    //will be used for insert operation
    $mode = $_POST[$rowId . "_!nativeeditor_status"];
    //get request mode
    switch ($mode) {
        case "inserted":
            //row adding request
            $action = add_row($rowId);
            break;
        case "deleted":
            //row deleting request
            $action = delete_row($rowId);
            break;
        default:
            //row updating request
            $action = update_row($rowId);
            break;
    }
    echo "<action type='" . $action . "' sid='" . $rowId . "' tid='" . $newId . "'/>";
}
echo "</data>";
Esempio n. 4
0
    $resDel = mysql_query($d_sql);
    return "delete";
}
//include XML Header (as response will be in xml format)
header("Content-type: text/xml");
//encoding may differ in your case
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
$mode = $_GET["!nativeeditor_status"];
//get request mode
$rowId = $_GET["gr_id"];
//id or row which was updated
$newId = $_GET["gr_id"];
//will be used for insert operation
switch ($mode) {
    case "inserted":
        //row adding request
        $action = add_row();
        break;
    case "deleted":
        //row deleting request
        $action = delete_row();
        break;
    default:
        //row updating request
        $action = update_row();
        break;
}
//output update results
echo "<data>";
echo "<action type='" . $action . "' sid='" . $rowId . "' tid='" . $newId . "'/>";
echo "</data>";
Esempio n. 5
0
switch ($_POST['action']) {
    case 'add':
        #Function for add row
        add_row($connection, $table, $user);
        break;
    case 'delete':
        #Function for delete row
        del_row($connection, $table, $user, $_GET['id']);
        break;
    case 'edit':
        #Function for edit form
        print_update_page($connection, $table, $user, $_GET['id']);
        exit;
    case 'update':
        #Function for update row
        update_row($connection, $table, $user);
        break;
    default:
        break;
}
#Function for print table
print_income($connection, $user, $from, $step, $url);
?>
		

		<div class="page_list">

			<?php 
#Вывод списка страниц
print_pages_list($connection, $table, $user, $step, $url);
?>
Esempio n. 6
0
 public function updateSubClass($catalogue, $sub, $cc)
 {
     global $db;
     list($classID, $cc_settings) = $db->get_row("SELECT Class_ID,CustomSettings FROM Sub_Class WHERE Sub_Class_ID=" . $cc, ARRAY_N);
     if ($classID == 2006) {
         eval($cc_settings);
         //			maildump(array($cc_settings, $CustomSettings));
         //склоняем название камня
         if ($CustomSettings['Name']) {
             $inflects = inflect(mb_strtolower($CustomSettings['Name']));
             foreach ($inflects as $k => $v) {
                 if ($k > 1) {
                     $CustomSettings['Name' . $k] = $v;
                 }
             }
             $cc_settings = "\$CustomSettings = array(";
             $comma = false;
             foreach ($CustomSettings as $k => $v) {
                 if ($comma) {
                     $cc_settings .= ',';
                 }
                 $comma = true;
                 $cc_settings .= "'{$k}' => '" . addslashes($v) . "'";
             }
             $cc_settings .= ');';
             update_row("Sub_Class", array('CustomSettings' => $cc_settings), "Sub_Class_ID=" . $cc);
         }
     }
 }
Esempio n. 7
0
                        } else {
                            if ($table == 'Reserved_Rooms') {
                                $values = array('Reservied_Date' => array('type' => 'string', 'value' => params('Reservied_Date')), 'Customer_ID' => array('type' => 'number', 'value' => params('Customer_ID')), 'Rent_Rate' => array('type' => 'number', 'value' => params('Rent_Rate')));
                            } else {
                                if ($table == 'Room_Types') {
                                    $values = array('Desc_EN' => array('type' => 'string', 'value' => params('Desc_EN')));
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    open_db();
    update_row($table, $pk, $id, $values);
    close_db();
    $posted = TRUE;
}
?>
          <?php 
if ($posted == FALSE) {
    ?>
          <?php 
    form_edit($table, $pk, $id);
    ?>
          <?php 
} else {
    ?>
          <p>
            Update complete
                     $bindargs[] = $bstr;
                 } else {
                     $bindargs[] = NULL;
                 }
                 break;
             default:
                 if ($value == '') {
                     $value = NULL;
                 }
                 $bindargs[] = empty($field['notnull']) && strlen($value) == 0 ? NULL : $value;
         }
         $cols[] = $field['name'];
         $k++;
     }
     if (count($bindargs) > 0) {
         $ib_error = $s_cust['enter']['as_new'] == TRUE ? insert_row($table, $cols, $bindargs) : update_row($table, $cols, $bindargs, substr($s_edit_where[$instance]['where'], 6));
         if (empty($ib_error)) {
             $success = TRUE;
             $s_enter_values = array();
             $s_watch_buffer = '';
             // cleanup the watchtable output buffer
             $s_watch_buffer = '';
         }
     }
 }
 $panels_arrayname = get_panel_array($_SERVER['SCRIPT_NAME']);
 if ($success || $job == 'cancel') {
     // remove the dt_edit panel
     $name = 'dt_edit' . $instance;
     $idx = get_panel_index(${$panels_arrayname}, $name);
     array_splice(${$panels_arrayname}, $idx, 1);