Exemple #1
0
            	
        
        if($bank_name != '' && $bank_id == ''){
        	if(!CheckBankExist($bank_name)){
        		AddBank($partn_id, $bank_name, $branch, $bank_code, $bank_acc);
        	} else {
        		$error = '"' . $bank_name . '" უკვე არის სიაში!';
        	}
        }else{
        	SaveBank($bank_id, $branch, $bank_code, $bank_acc);
        }
        */
        break;
    case 'disable':
        $acc_id = $_REQUEST['id'];
        Disable($acc_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Partner Accounts Functions
 * ******************************
 */
function Disable($acc_id)
{
}
function AddAccount($partn_id, $bank_name, $branch, $bank_code, $bank_acc)
{
if (!$user->AsArticaMetaAdmin) {
    $tpl = new templates();
    header("content-type: application/x-javascript");
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
}
if (isset($_GET["justbutton"])) {
    justbutton_js();
    exit;
}
if (isset($_GET["popup-justbutton"])) {
    justbutton();
    exit;
}
if (isset($_POST["Disable"])) {
    Disable();
    exit;
}
justbutton_js();
function justbutton_js()
{
    $tpl = new templates();
    $artica_meta = new mysql_meta();
    $uuid = $_GET["uuid"];
    if (intval($_GET["gpid"]) == 0) {
        $hostname = $artica_meta->uuid_to_host($_GET["uuid"]);
    } else {
        $hostname = $tpl->javascript_parse_text("{computers}: ") . $artica_meta->gpid_to_name($_GET["gpid"]);
    }
    $title = $tpl->_ENGINE_parse_body("{$hostname}:{enable_emergency_mode}");
    $page = CurrentPageName();
Exemple #3
0
        break;
    case 'save_detail':
        if ($value != '') {
            if (!CheckDetailExist($value)) {
                if ($id_detail == '') {
                    AddDetail($id_original, $value);
                } else {
                    SaveDetail($id_detail, $value);
                }
            } else {
                $error = '"' . $name . '" უკვე არის სიაში!';
            }
        }
        break;
    case 'disable':
        Disable($id);
        break;
    case 'disable_detail':
        DisableDetail($id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Category Functions
* ******************************
*/
function Add($id, $name)
{
Exemple #4
0
                $in_id = AddPartner($user_id, $p_identity_id, $arr);
                $data = array('in_id' => $in_id);
            } else {
                $error = '"' . p_identity_id . '" უკვე არის სიაში!';
            }
        } else {
            SavePartner($user_id, $part_id, $p_identity_id, $arr);
        }
        break;
    case 'get_local_id':
        $local_id = GetLocalID();
        $data = array('local_id' => $local_id);
        break;
    case 'disable':
        $part_id = $_REQUEST['id'];
        Disable($part_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
function Disable($part_id)
{
    mysql_query("UPDATE `partners`\n\t\t\t\tSET    `actived` = 0\n\t\t\t\tWHERE \t`id` = {$part_id}");
}
function GetLocalID()
{
    global $db;
    $local_id = $db->increment('partners');
    return $local_id;
        $service_degree_t = $_REQUEST['d'];
        $comment = $_REQUEST['c'];
        if ($service_degree_id == '') {
            AddCall($user_id, $client_object_id, $person_name, $service_degree_t, $comment);
        } else {
            SaveCall($service_degree_id, $user_id, $client_object_id, $person_name, $service_degree_t, $comment);
        }
        break;
    case 'getperson':
        $pers_name = $_REQUEST['n'];
        $array = GetPerson($pers_name);
        $data = array('phone' => $array[0], 'email' => $array[1]);
        break;
    case 'disable':
        $list_id = $_REQUEST['id'];
        Disable($list_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Client Object Person List Functions
 * ******************************
 */
function GetPerson($person_name)
{
    $res = mysql_fetch_assoc(mysql_query("\tSELECT\tphone_number,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmail\r\n\t\t\t\t\t\t\t\t\t\t\tFROM\tclient_object_persons\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE\tclient_object_persons.`name` = '{$person_name}'"));
    $arr = array("0" => $res['phone_number'], "1" => $res['mail']);
    return $arr;
Exemple #6
0
        //
        $object_id = $_REQUEST['id'];
        $name = $_REQUEST['na'];
        $type = $_REQUEST['t'];
        $parent = $_REQUEST['p'];
        $address = $_REQUEST['a'];
        $warehouse = $_REQUEST['w'];
        if ($object_id == '') {
            AddObject($user_id, $name, $type, $parent, $address, $warehouse);
        } else {
            SaveObject($user_id, $object_id, $name, $type, $parent, $address, $warehouse);
        }
        break;
    case 'disable':
        $object_id = $_REQUEST['id'];
        Disable($object_id);
        break;
    default:
        $error = 'Action is Null';
}
$output['error'] = $error;
echo json_encode($output);
function GetObb($object_id)
{
    $res = mysql_fetch_assoc(mysql_query("\tSELECT\t`object`.`ID`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`name`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`address`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`object`.`warehouse`\n\t\t\t\t\t\t\t\t\t\t\t\tFROM\t`object`\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE   `object`.`actived` = 1 && `id`={$object_id}"));
    return $res;
}
function AddObject($user_id, $name, $type, $parent, $address, $warehouse)
{
    if ($warehouse == '' || $warehouse == 0) {
        mysql_query("INSERT INTO `object`\n\t\t\t(`user_id`, `name`, `type`, `parent`, `address`,warehouse)\n\t\t\tVALUES\n\t\t\t({$user_id}, '{$name}', {$type}, {$parent}, '{$address}',NULL)");
            }
            $data['aaData'][] = $row;
        }
        break;
    case 'save_timetable':
        $timetable_id = $_REQUEST['id'];
        $arr = array("client_id" => $_REQUEST['cid'], "cartridge_done_time" => $_REQUEST['cdt'], "printer_done_time" => $_REQUEST['pdt'], "timetable_type" => $_REQUEST['t_type'], "request_time" => $_REQUEST['rt'], "request_time_type" => $_REQUEST['rtt'], "request_min_quantity" => $_REQUEST['rminq'], "request_max_quantity" => $_REQUEST['rmaxq'], "done_time" => $_REQUEST['dt'], "days" => $_REQUEST['d']);
        SaveTimtable($timetable_id, $user_id, $arr);
        break;
    case 'get_local_id':
        $local_id = GetLocalID();
        $data = array('local_id' => $local_id);
        break;
    case 'disable':
        $timetable_id = $_REQUEST['id'];
        Disable($timetable_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Client Cartridge List Functions
 * ******************************
 */
function SaveTimtable($timetable_id, $user_id, $arr)
{
    global $error;
    $result = mysql_query("INSERT IGNORE INTO `client_timetable` (`id`) VALUES ( {$timetable_id} )");
    if (!$result) {
Exemple #8
0
        $branch = $_REQUEST['bb'];
        $bank_code = $_REQUEST['bc'];
        $bank_acc = $_REQUEST['ba'];
        if ($bank_name != '' && $bank_id == '') {
            if (!CheckBankExist($bank_name)) {
                AddBank($user_id, $partner_id, $bank_name, $branch, $bank_code, $bank_acc);
            } else {
                $error = '"' . $bank_name . '" უკვე არის სიაში!';
            }
        } else {
            SaveBank($user_id, $bank_id, $partner_id, $bank_name, $branch, $bank_code, $bank_acc);
        }
        break;
    case 'disable':
        $bank_id = $_REQUEST['id'];
        Disable($bank_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Partner Bank Functions
 * ******************************
 */
function AddBank($user_id, $partner_id, $bank_name, $branch, $bank_code, $bank_acc)
{
    mysql_query("INSERT INTO `partner_bank`\r\n\t\t\t\t\t(`user_id`,`partner_id`, `name`, `object`, `code`, `account`) \r\n\t\t\t\t VALUES\r\n\t\t\t\t \t({$user_id}, '{$partner_id}', '{$bank_name}', '{$branch}', '{$bank_code}', '{$bank_acc}')");
}
function CheckBankExist($bank_name)
        $quantity = $_REQUEST['tq'];
        $real_quantity = $_REQUEST['rq'];
        $prod_id = GetProductID($prod_name);
        if ($comp_id == '') {
            if (!CheckProductionExist($local_id, $prod_id)) {
                AddProduction($local_id, $prod_id, $quantity, $real_quantity);
            } else {
                $error = '"' . $prod_name . '" უკვე არის სიაში!';
            }
        } else {
            SaveProduction($comp_id, $prod_id, $quantity, $real_quantity);
        }
        break;
    case 'disable':
        $describe_detail_id = $_REQUEST['id'];
        Disable($describe_detail_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Recipie Production List Functions
 * ******************************
 */
function AddProduction($local_id, $prod_id, $quantity, $real_quantity)
{
    mysql_query("INSERT INTO `describe_detail`\r\n\t\t\t\t\t(`describe_id`, `production_id`, `quantity`, `real_quantity`) \r\n\t\t\t\t VALUES\r\n\t\t\t\t\t({$local_id}, {$prod_id}, {$quantity}, {$real_quantity})");
}
function SaveProduction($comp_id, $prod_id, $quantity, $real_quantity)