$group_pages = json_decode(stripslashes($_REQUEST['pag'])); $data = array('inserted_value' => SaveGroup($group_name, $group_pages), 'inserted_name' => $group_name); global $log; $log->setInsertLog('group'); break; case 'get_add_group_page': $page = GetGroupPage(); $data = array('page' => $page); break; case 'disable': $per_id = $_REQUEST['id']; DisableWorker($per_id); break; case 'delete_image': $pers_id = $_REQUEST['id']; DeleteImage($pers_id); break; case 'clear': $file_list = $_REQUEST['file']; ClearProduct(); if (!empty($file_list)) { $file_list = ClearFiles(json_decode($file_list)); } $data = array('file_list' => json_encode($file_list)); default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * Workers Functions
global $log; $log->setInsertLog('production_category'); } else { $error = '"' . $cat_name . '" უკვე არის სიაში!'; } } else { SaveCategory($cat_id, $cat_name, $image, $checked); } break; case 'disable': $cat_id = $_REQUEST['id']; DisableCategory($cat_id); break; case 'delete_image': $cat_id = $_REQUEST['id']; DeleteImage($cat_id); break; default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * Category Functions * ****************************** */ function DeleteImage($cat_id) { global $log; $log->setUpdateLogBefore('production_category', $cat_id); mysql_query("UPDATE\r\n\t`production_category`\r\n\tSET\r\n\t`image`\t\t\t= NULL\r\n\tWHERE\r\n\t`id`\t\t\t= {$cat_id}");
$error = 'პროდუქტი ასეთი კოდით უკვე არის სიაში!'; } } else { $error = '"' . $arr['name'] . '" უკვე არის სიაში!'; } } else { SaveProduct($prod_id, $user_id, $arr); } break; case 'disable': $prod_id = $_REQUEST['id']; DisableProduct($prod_id); break; case 'delete_image': $prod_id = $_REQUEST['id']; DeleteImage($prod_id); break; case 'clear': $file_list = $_REQUEST['file']; ClearProduct(); if (!empty($file_list)) { $file_list = ClearFiles(json_decode($file_list)); } $data = array('file_list' => json_encode($file_list)); break; default: $error = "Action is Null"; } $data['error'] = $error; echo json_encode($data); /* ******************************
if (!CheckClientExist($arr['rs_id'])) { AddClient($user_id, $arr); } else { $error = '"' . $arr['name'] . '" უკვე არის სიაში!'; } } else { SaveClient($client_id, $user_id, $arr); } break; case 'disable': $client_id = $_REQUEST['id']; DisableClient($client_id); break; case 'delete_image': $client_id = $_REQUEST['id']; DeleteImage($client_id); break; case 'get_local_id': $local_id = GetLocalID(); $data = array('local_id' => $local_id); break; case 'clear_db': ClearDB(); break; case 'clear': $file_list = $_REQUEST['file']; if (!empty($file_list)) { $file_list = ClearFiles(json_decode($file_list)); } $data = array('file_list' => json_encode($file_list)); break;