<?php $urlrq=$_SERVER['DOCUMENT_ROOT']; require_once($urlrq."/core/mysql.php"); require_once($urlrq."/core/account.php"); require_once($urlrq."/core/console.preferences.php"); require_once ($urlrq."/configuration.php"); $accID= $CurrentAccount->ID; $acc = new account(); $acc->ID=$accID; $dbname = $acc->get_database_name_id(); if(isset($_POST['action'])) { $action = $_POST['action']; } else { if (isset($_GET['action'])) { $action = $_GET['action']; } } switch($action) { case "get-description" : $name=$_POST['name']; $AccountID = $_POST['AccountID']; $preferences = new preferences(); $result = $preferences->show_description_table_preferences($name, $AccountID); echo json_encode($result); break; case "show_detail_preferences_table": $name= $_POST['name']; $AccountID = $_POST['AccountID']; $preferences = new preferences(); $preferences->name = $name; $preferences->AccountID = $AccountID; $result = $preferences->show_detail_preferences_table(); if ( $result == false ) { $result = $preferences->add_project_table(); $result = $preferences->show_detail_preferences_table(); echo json_encode($result); } else { echo json_encode($result); } break; case "update_preferences_table" : //skjhfskjhkjshdshjd $preferences = new preferences(); $DisplayName = $_POST['DisplayName']; $Description = $_POST['description']; $preferences->AccountID = $_POST['AccountID']; $preferences->name = $_POST['name']; $preferences->description = $_POST['description']; $preferences->ErrorOccurs = $_POST['ErrorOccurs']; $preferences->Postpone = $_POST['Postpone']; $preferences->Ignores= $_POST['Ignores']; $preferences->DeleteOldItems = $_POST['DeleteOldItems']; $preferences->RunAnonymously = $_POST['RunAnonymously']; $preferences->DontCreate = $_POST['DontCreate']; $preferences->StopProcessing = $_POST['StopProcessing']; $preferences->DontProcessMultiple = $_POST['DontProcessMultiple']; $preferences->ImagesProcessing = $_POST['ImagesProcessing']; $preferences->update_preferences(); $preferences->update_project_table($DisplayName, $Description); echo "Change setting Preference success ! "; break; }