You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
918 B
27 lines
918 B
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$SiteID = intval( $_POST['SITE'] );
|
|
$UID = intval( $CUser->Data['id'] );
|
|
$A = $_POST['PANEL'];
|
|
$TARR=explode( '_', $A );
|
|
$NID = intval( $TARR[2] );
|
|
if( $NID > 0 ){
|
|
$COL = intval( $_POST['X'] );
|
|
$ROW = intval( $_POST['Y'] );
|
|
$QS = "DELETE FROM users_dash_layout WHERE user_id={$UID} AND node_id={$NID}";
|
|
$DATABASE->Query( $QS, false );
|
|
$QS = "SELECT * FROM users_dash_layout WHERE user_id={$UID} AND x={$COL}";
|
|
$result = $DATABASE->Query( $QS, false );
|
|
foreach( $result as $R ){
|
|
if( $R['y'] >= $ROW ){
|
|
$R['y']++;
|
|
$QS = "UPDATE users_dash_layout SET y={$R['y']} WHERE id={$R['id']}";
|
|
$DATABASE->Query( $QS, false );
|
|
};
|
|
};
|
|
$QS = "INSERT INTO users_dash_layout SET x={$COL}, y={$ROW}, node_id={$NID}, user_id={$UID}";
|
|
$DATABASE->Query( $QS, false );
|
|
};
|
|
};
|
|
?>
|