예제 #1
0
function set_taxtable()
{
    global $token;
    $post_data = '<?xml version="1.0" encoding="utf-8"?>
<SetTaxTableRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <TaxTable>
    <TaxJurisdiction>
        <JurisdictionID>AZ</JurisdictionID>
        <SalesTaxPercent>8.25</SalesTaxPercent>
        <ShippingIncludedInTax>true</ShippingIncludedInTax>
      </TaxJurisdiction>
      <TaxJurisdiction>
        <JurisdictionID>MI</JurisdictionID>
        <SalesTaxPercent>6.0</SalesTaxPercent>
        <ShippingIncludedInTax>false</ShippingIncludedInTax>
      </TaxJurisdiction>
  </TaxTable>
  <ErrorLanguage>en_US</ErrorLanguage>
  <RequesterCredentials>
		<eBayAuthToken>' . $token . '</eBayAuthToken>
		</RequesterCredentials>
  <WarningLevel>High</WarningLevel>
</SetTaxTableRequest>';
    $body = callapi($post_data, 'SetTaxTable');
    return $body;
}
function add_fixed_price_item()
{
    global $token, $asin, $title, $ebay_price, $ebay_description, $image_url, $weight, $height, $width, $length, $brand, $ean, $currency_code, $dispatch_time_max, $sku, $upc, $quantity, $condition_id, $listing_type, $duration, $refund_option, $shipping_service, $shipping_type, $shipping_cost, $payment_method, $cat_id, $return_within, $uuid, $site, $mpn;
    $post_data = '<?xml version="1.0" encoding="utf-8"?>
						<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
						<ErrorLanguage>en_US</ErrorLanguage>
						<WarningLevel>High</WarningLevel>
						<Item>
							<Title>' . $title . '</Title>
							<SKU>' . $sku . '</SKU>
							<PrimaryCategory>
							   <CategoryID>' . $cat_id . '</CategoryID>
							</PrimaryCategory>
							<Description><![CDATA[' . $ebay_description . ']]></Description>
							<StartPrice>' . $ebay_price . '</StartPrice>
							<ConditionID>' . $condition_id . '</ConditionID>
							<Country>US</Country>
							<CategoryMappingAllowed>true</CategoryMappingAllowed>
							<Currency>' . $currency_code . '</Currency>
							<DispatchTimeMax>' . $dispatch_time_max . '</DispatchTimeMax>
							<ListingType>' . $listing_type . '</ListingType>
							<ListingDuration>' . $duration . '</ListingDuration>
							<PaymentMethods>' . $payment_method . '</PaymentMethods>
							<PayPalEmailAddress>rinsad@gmail.com</PayPalEmailAddress>
							<PictureDetails>
								<PictureURL>' . $image_url . '</PictureURL>
							</PictureDetails>
							<PostalCode>95125</PostalCode>
							<Quantity>' . $quantity . '</Quantity>
							<ReturnPolicy>
								<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
								<RefundOption>' . $refund_option . '</RefundOption>
								<ReturnsWithinOption>' . $return_within . '</ReturnsWithinOption>
								<Description>If you are not satisfied, return the item for refund.</Description>
								<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
							</ReturnPolicy>
							<ShippingDetails>
								<ShippingType>' . $shipping_type . '</ShippingType>
								<InternationalShippingDiscountProfileID>0</InternationalShippingDiscountProfileID>
								 <ShippingDiscountProfileID>0</ShippingDiscountProfileID>
								<ShippingServiceOptions>
									<ShippingServicePriority>1</ShippingServicePriority>
									<ShippingService>' . $shipping_service . '</ShippingService>
									<ShippingServiceCost>' . $shipping_cost . '</ShippingServiceCost>
									<ShippingServiceAdditionalCost>30</ShippingServiceAdditionalCost>
								</ShippingServiceOptions>
							</ShippingDetails>
							<UUID>' . $uuid . '</UUID>
							<Site>' . $site . '</Site>
						
							</Item>
							<RequesterCredentials>
							<eBayAuthToken>' . $token . '</eBayAuthToken>
							</RequesterCredentials>
							<WarningLevel>High</WarningLevel>
							</AddFixedPriceItemRequest>';
    $body = callapi($post_data, "AddFixedPriceItem");
    return $body;
}
예제 #3
0
$requestparam = substr($requestparam, 0, -1);
for ($i = 5; $i <= 51; $i = $i * 2) {
    if ($i == $limit) {
        $sss = "selected";
    } else {
        $sss = "";
    }
    $slt .= "<option {$sss} value='{$i}'>{$i}</option> \n";
}
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers = array();
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$gets['from_row'] = $pages;
$gets['max_result'] = $limit;
$scyapi = callapi($headers, '', $gets, "api/schools/years");
$scydatas = explode("\n", $scyapi['output']);
$scydata = json_decode(end($scydatas));
//print_r($scydata->messageObject);
echo <<<eot

<div class="dataTables_wrapper form-inline">
\t<div class="row-fluid">
\t\t<div class="span6">
\t\t\t<div class="limit">
\t\t\t\t<label>
\t\t\t\t\t<select class="input-mini" name="limit">
\t\t\t\t\t\t{$slt}
\t\t\t\t\t</select> {$lang_recordperpage}
\t\t\t\t\t<span id='limitloadtext'></span>
\t\t\t\t</label>
예제 #4
0
        $headers[] = "Content-Type: application/json";
        $headers[] = "cache-control: no-cache";
        $headers[] = "Content-Length:" . strlen($message);
        $posts = $message;
        $sendapi = callapi($headers, $posts, '', 'api/messages/create');
    } else {
        $messages['school_id'] = $myprofile->school_id;
        $messages['content'] = $message;
        $messages['dest_type'] = $send_type;
        $messages['class_id'] = $filter_class_lists[0];
        $messages['cc_list'] = $filter_class_list;
        $message = json_encode($messages);
        $headers[] = "Content-Type: application/json";
        $headers[] = "Content-Length:" . strlen($message);
        $posts = $message;
        $sendapi = callapi($headers, $posts, '', 'api/messages/create_ext');
    }
    //print_r($sendapi);
    //echo $message;
    //echo $sendapi['output'];
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> ຂໍ້​ຄວາມ Sent!</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/msg/msg_manager_db.php?lang={$lang}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
예제 #5
0
$myprofile = json_decode(end($userdatas));
$err = '';
$arr['sval'] = $_REQUEST['sval'];
$arr['id'] = $_REQUEST['id'];
$arr['fval1'] = $_REQUEST['fval1'];
$arr['fval2'] = $_REQUEST['fval2'];
$arr['lval'] = $_REQUEST['lval'];
$arr['notice'] = $_REQUEST['notice'];
$arr['school_id'] = $_REQUEST['school_id'];
//$arr['table'] = $_REQUEST['table'];
$table = $_REQUEST['table'];
$djson = json_encode($arr);
//echo "<textarea>$djson</textarea>";
if ($err == "") {
    $posts = $djson;
    $sendapi = callapi($headers, $posts, '', "api/masters/update/{$table}");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        if ($sendapi['http_code'] == 400) {
            $status[] = $sendapidata->developerMessage;
        } else {
            $status[] = $sendapi['http_code'];
        }
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
예제 #6
0
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$userdata = callapi($headers, '', '', 'api/users/myprofile');
$userdatas = explode("\n", $userdata['output']);
$myprofile = json_decode(end($userdatas));
$infdata = callapi($headers, '', '', "api/schools/{$myprofile->school_id}");
$infdatas = explode("\n", $infdata['output']);
$schooldata = json_decode(end($infdatas));
//print_r($schooldata);
$prvdata = callapi($headers, '', '', "api/sys/sys_province");
$prvdatas = explode("\n", $prvdata['output']);
$provincedata = json_decode(end($prvdatas));
$dgrdata = callapi($headers, '', '', "api/sys/sys_degree");
$dgrdatas = explode("\n", $dgrdata['output']);
$degreedata = json_decode(end($dgrdatas));
$disdata = callapi($headers, '', '', "api/sys/sys_dist");
$disdatas = explode("\n", $disdata['output']);
$distdata = json_decode(end($disdatas));
//print_r($distdata);
?>
<div class="bs-docs-example">
	<div class="navbar navbar-static">
		<div class="navbar-inner">
			<div style="width: auto;" class="container">
				<a href="javascript:;" class="brand"><?php 
lang('sclmanager');
?>
</a>
				<ul class="nav">
					<li <?php 
echo $type == 'search' || $type == '' ? "class='active'" : "";
예제 #7
0
    ?>
</label>
			<div class="controls">
				<select name="filter_class_id" data-placeholder="Select Class" class="span3">
					<option value="">- <?php 
    lang('selectcls');
    ?>
 -</option>
					<?php 
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $gets['from_row'] = 0;
    $gets['max_result'] = 9999;
    $clsaip = callapi($headers, '', $gets, 'api/classes');
    $clsdatas = explode("\n", $clsaip['output']);
    $clsdata = json_decode(end($clsdatas));
    foreach ($clsdata->list as $lists) {
        echo "<option value='{$lists->id}'>{$lists->title}</option>";
    }
    ?>
				</select>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label"><?php 
    lang('sltdate');
    ?>
예제 #8
0
$arr['description'] = $_REQUEST['description'];
$arr['term_val'] = $_REQUEST['term_val'];
$class_id = $_REQUEST['class_id'];
$djson = json_encode($arr);
$err = '';
foreach ($_REQUEST as $key => $r) {
    if ($key == 'submit' || $key == 'description') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $posts = $djson;
    $sendapi = callapi($headers, $posts, '', "api/timetables/update");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    if ($sendapi['http_code'] != 200) {
        if ($sendapi['http_code'] == 400) {
            $status[] = $sendapidata->developerMessage;
        } else {
            $status[] = $sendapi['http_code'];
        }
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
예제 #9
0
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $headers[] = "Content-Type: multipart/form-data;";
    $posts = array();
    $posts['file'] = new \CurlFile(realpath("../../uploads/{$uploadedfile}"), 'image/png', $uploadedfile);
    $posts['class_id'] = $class_id;
    //print_r($posts);
    $sendapi = callapi($headers, $posts, '', 'api/users/upload_file');
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_usrimported}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/usr/usr_manager_db.php?lang={$lang}&table={$table}&filter_user_role=STUDENT','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
    echo "<span class='label label-important'><i class='icon-usro-sign'></i> {$err}</span>";
예제 #10
0
function ebay_revise_item($item_id, $revise_price, $revise_qty)
{
    global $token, $paypal_email, $return_accept_option, $refund_option, $return_within_days, $duration;
    $post_data = '<?xml version="1.0" encoding="utf-8"?>
  <ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <ErrorLanguage>en_US</ErrorLanguage>
  <Item>
    <ItemID>' . $item_id . '</ItemID>
    <StartPrice>' . $revise_price . '</StartPrice>
    <Quantity>' . $revise_qty . '</Quantity>
        <PayPalEmailAddress>' . $paypal_email . '</PayPalEmailAddress>
        <ListingDuration>' . $duration . '</ListingDuration>
	<ReturnPolicy>
            <ReturnsAcceptedOption>' . $return_accept_option . '</ReturnsAcceptedOption>
            <RefundOption>' . $refund_option . '</RefundOption>
            <ReturnsWithinOption>' . $return_within_days . '</ReturnsWithinOption>
            <ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
	</ReturnPolicy>
  </Item>
  <RequesterCredentials>
  <eBayAuthToken>' . $token . '</eBayAuthToken>
  </RequesterCredentials>
  <WarningLevel>High</WarningLevel>
  </ReviseItemRequest>';
    $body = callapi($post_data, 'ReviseItem');
    return $body;
}
예제 #11
0
    ?>
				</select>
				
				<select name="filter_subject_id" data-placeholder="Select Subject" class="span3">
					<option value="">- <?php 
    lang('sltsubject');
    ?>
 -</option>
					<?php 
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $gets['from_row'] = 0;
    $gets['max_result'] = 9999;
    $sjtaip = callapi($headers, '', $gets, 'api/masters/m_subject');
    $sjtdatas = explode("\n", $sjtaip['output']);
    $sjtdata = json_decode(end($sjtdatas));
    foreach ($sjtdata->messageObject->list as $lists) {
        echo "<option value='{$lists->id}'>{$lists->sval}</option>";
    }
    ?>
				</select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<button type="submit" class="btn btn-info" name="submit"><i class="icon-search"></i> <?php 
    lang('search');
예제 #12
0
\t</div>
\t
\t<table class="table table-bordered table-hover dataTable">
\t\t<thead> 
\t\t\t<tr> 
\t\t\t\t<th>{$lang_year}</th>
\t\t\t\t<th>{$lang_term}</th>
\t\t\t\t<th>{$lang_startdate}</th>
\t\t\t\t<th>{$lang_enddate}</th>
\t\t\t\t<th>{$lang_status}</th>
\t\t\t\t<th>{$lang_notice}</th>
\t\t\t\t<th colspan=2>{$lang_action}</th>
eot;
echo "</tr>\n\t\t</thead>";
echo "<tbody>";
$yrsaip = callapi($headers, '', $gets, 'api/schools/years');
$yrsdatas = explode("\n", $yrsaip['output']);
$yrsdata = json_decode(end($yrsdatas));
//print_r($yrsdata);
foreach ($trmdata->messageObject as $lists) {
    $lists->start_dt = reset(explode(' ', $lists->start_dt));
    $lists->end_dt = reset(explode(' ', $lists->end_dt));
    foreach ($yrsdata->messageObject as $yrslists) {
        if ($yrslists->id == $lists->year_id) {
            $year = $yrslists->years;
            break;
        }
    }
    if ($lists->actived == 0) {
        $actived_text = $lang_inactive;
    }
예제 #13
0
$myprofile = json_decode(end($userdatas));
$err = '';
$id = $_REQUEST['id'];
$actived = $_REQUEST['actived'];
$err = '';
foreach ($_REQUEST as $key => $r) {
    if ($key == 'submit') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $posts = "x";
    $sendapi = callapi($headers, $posts, '', "api/terms/activate/{$id}/{$actived}");
    //echo "api/terms/activate/$id/$actived";
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_updated}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/mtb/mtb_trm_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
예제 #14
0
			<label class="control-label"><?php 
    lang('status');
    ?>
</label>
			<div class="controls">
				<select name="sts" class="input-large">
					<option value="">- <?php 
    lang('status');
    ?>
 -</option>
					<?php 
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $stsaip = callapi($headers, '', $gets, 'api/sys/sys_sts');
    $stsdatas = explode("\n", $stsaip['output']);
    $stsdata = json_decode(end($stsdatas));
    foreach ($stsdata->messageObject->list as $lists) {
        $selected = $lists->id == $clsdata->sts ? "selected" : "";
        echo "<option {$selected} value='{$lists->id}'>{$lists->sval}</option>";
    }
    ?>
				</select>
				
			</div>
		</div>
		
		<div class="form-actions">
			<button type="submit" class="btn btn-info" name="submit"><i class="icon-edit"></i> <?php 
    lang('edit');
예제 #15
0
    }
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapidatas);
    //ອັບ​ໂຫຼດ photo
    if ($uploadedfile != '') {
        $headers = array();
        $auth_key = $_SESSION[$config_session]['auth_key'];
        $headers[] = "auth_key: {$auth_key}";
        $headers[] = "api_key: TEST_API_KEY";
        $headers[] = "Content-Type: multipart/form-data;";
        $posts = array();
        //$posts['file'] = '@'.realpath("../../uploads/$uploadedfile");
        $posts['file'] = new \CurlFile(realpath("../../uploads/{$uploadedfile}"), 'image/png', $uploadedfile);
        $posts['user_id'] = $sendapidata->id;
        //print_r($posts);
        $sendapi = callapi($headers, $posts, '', 'api/users/upload_photo');
        $sendapidatas = explode("\n", $sendapi['output']);
        $sendapidata = json_decode(end($sendapidatas));
        if ($sendapi['http_code'] != 200) {
            $status[] = $sendapi['http_code'];
            $status[] = $sendapidata->developerMessage;
        }
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_usreadded}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/usr/usr_manager_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
예제 #16
0
<?php

include "../../config.php";
ensure_permission('usr');
ensure_role('mod,sadmin,admin');
$date = date('Y') . date('m') . date('d');
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=user.csv");
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers = array();
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$usrapi = callapi($headers, '', '', "/api/users/download_csv");
$usrdatas = explode("\n", $usrapi['output']);
$usrdata = json_decode(end($usrdatas));
echo $usrdatas[15] . "\n";
echo $usrdatas[16];
예제 #17
0
파일: index.php 프로젝트: LAOSChool/Web
            $auth_key = str_replace('auth_key: ', '', $header);
        }
    }
    curl_close($ch);
    $data['http_code'] = $info['http_code'];
    $data['auth_key'] = $auth_key;
    $data['headers'] = $headers;
    $data['output'] = $output;
    return $data;
}
$type = $_REQUEST['type'];
$time = time();
$headers = array();
$headers[] = "api_key: WEB";
$school_id = $_REQUEST['school_id'];
$infdata = callapi($headers, '', '', "non-secure/schools/{$school_id}");
$infdatas = end(explode("\n", $infdata['output']));
$schooldata = json_decode($infdatas);
//echo "non-secure/schools/$school_id";
//print_r($infdata);
?>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
예제 #18
0
$submit = $_REQUEST['submit'];
if ($submit == '') {
    die("");
}
if ($err == "") {
    foreach ($user_ids as $user_id) {
        $headers = array();
        $auth_key = $_SESSION[$config_session]['auth_key'];
        $headers[] = "auth_key: {$auth_key}";
        $headers[] = "api_key: TEST_API_KEY";
        $posts['user_id'] = $user_id;
        $posts['class_id'] = $class_id;
        if ($submit == 'edit') {
            $sendapi = callapi($headers, $posts, '', "api/users/assign_to_class");
        } elseif ($submit == 'remove') {
            $sendapi = callapi($headers, $posts, '', "api/users/remove_frm_class");
        }
        $sendapidatas = explode("\n", $sendapi['output']);
        $sendapidata = json_decode(end($sendapidatas));
        //print_r($sendapidata);
        if ($sendapi['http_code'] != 200) {
            $status[] = $sendapi['http_code'];
            $status[] = $sendapidata->developerMessage;
        }
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_assigned}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/cls/cls_setclass_db.php?lang={$lang}&filter_user_role={$filter_user_role}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
예제 #19
0
}
$class_ids = implode(',', $class_id);
$err = '';
foreach ($_REQUEST as $key => $r) {
    if ($key == 'submit') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $posts['class_ids'] = $class_ids;
    $posts['ex_key'] = $ex_key;
    //echo "api/exam_results/ranks/process?class_ids=$class_ids&ex_key=$ex_key";
    $sendapi = callapi($headers, $posts, '', "api/exam_results/ranks/process?class_ids={$class_ids}&ex_key={$ex_key}");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_genedrank}!</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\t//loadform('includes/rnk/rnk_manager_db.php?lang={$lang}&filter_class_id={$class_id}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
    echo "<span class='label label-important'><i class='icon-rnko-sign'></i> {$err}</span>";
예제 #20
0
        $sendapidatas = explode("\n", $sendapi['output']);
        $sendapidata = json_decode(end($sendapidatas));
        if ($sendapi['http_code'] != 200) {
            $status[] = $sendapi['http_code'];
            $status[] = $sendapidata->developerMessage;
        }
    }
    $djson = json_encode($arr);
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $headers[] = "Content-Type: application/json";
    $posts = $djson;
    //$posts = '{"id":2,"school_id":1,"class_id":1,"exam_id":null,"exam_name":null,"exam_type":1,"exam_dt":null,"subject_id":2,"teacher_id":null,"student_id":14,"student_name":"Student 14","notice":"Normal exam","sresult":"1","term_id":1,"exam_month":9,"exam_year":2016,"term_val":null,"sch_year_id":0,"subject":"Ly","teacher":null,"term":"HK 1"}';
    $sendapi = callapi($headers, $posts, '', 'api/schools/update');
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "\n\t\t\t<script language='javascript'>\n\t\t\t\tloadform('includes/inf/inf_manager_form.php?lang={$lang}','#parameter','#loadtext1');\n\t\t\t</script>\n\t\t\t<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_updated}</span>\n\t\t\t";
    }
} else {
    echo "<span class='label label-important'><i class='icon-info-sign'></i> {$err}</span>";
예제 #21
0
$arr['term_val'] = $_REQUEST['term_val'];
$arr['notice'] = $_REQUEST['notice'];
$djson = json_encode($arr);
//echo "<textarea>$djson</textarea>";
$err = '';
foreach ($_REQUEST as $key => $r) {
    if ($key == 'submit') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $posts = $djson;
    $sendapi = callapi($headers, $posts, '', "api/terms/update");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_edited}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/mtb/mtb_trm_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
예제 #22
0
$headers = array();
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$userdata = callapi($headers, '', '', 'api/users/myprofile');
$userdatas = explode("\n", $userdata['output']);
$myprofile = json_decode(end($userdatas));
if ($filter_to_dt != '') {
    $gets['filter_to_dt'] = $filter_to_dt;
}
if ($filter_from_dt != '') {
    $gets['filter_from_dt'] = $filter_from_dt;
}
//$gets['filter_from_user_id'] = $myprofile->id;
$gets['from_row'] = $pages;
$gets['max_result'] = $limit;
$ntfapi = callapi($headers, '', $gets, 'api/notifies');
//print_r($ntfapi);
$ntfdatas = explode("\n", $ntfapi['output']);
$ntfdata = json_decode(end($ntfdatas));
//print_r($ntfdata->list[0]);
echo <<<eot

<div class="dataTables_wrapper form-inline">
\t<div class="row-fluid">
\t\t<div class="span6">
\t\t\t<div class="limit">
\t\t\t\t<label>
\t\t\t\t\t<select class="input-mini" name="limit">
\t\t\t\t\t\t{$slt}
\t\t\t\t\t</select> {$lang_recordperpage}
\t\t\t\t\t<span id='limitloadtext'></span>
예제 #23
0
$djson = $_REQUEST['djson'];
$ddjson = json_decode($djson);
$m1 = "m" . $ddjson->filter_exam_month;
$m = json_decode($ddjson->{$m1});
$err = '';
if (!is_numeric($m->sresult) || $m->sresult > 10) {
    $err = "Result must is number and <10";
}
if ($err == "") {
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $headers[] = "Content-Type: application/json";
    $posts = $djson;
    //$posts = '{"id":2,"school_id":1,"class_id":1,"exam_id":null,"exam_name":null,"exam_type":1,"exam_dt":null,"subject_id":2,"teacher_id":null,"student_id":14,"student_name":"Student 14","notice":"Normal exam","sresult":"1","term_id":1,"exam_month":9,"exam_year":2016,"term_val":null,"sch_year_id":0,"subject":"Ly","teacher":null,"term":"HK 1"}';
    $sendapi = callapi($headers, $posts, '', 'api/exam_results/input');
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$m->sresult}</span>\n\t\t\t";
    }
} else {
    echo "<span class='label label-important'><i class='icon-info-sign'></i> {$err}</span>";
}
예제 #24
0
		</div>
	</form>
	
<?php 
} elseif ($type == 'edit') {
    ?>
	<?php 
    $id = $_REQUEST['id'];
    $table = $_REQUEST['table'];
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers = array();
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $gets['from_row'] = $pages;
    $gets['max_result'] = $limit;
    $mtbapi = callapi($headers, '', $gets, "/api/masters/{$table}/{$id}");
    $mtbdatas = explode("\n", $mtbapi['output']);
    $mtbdata = json_decode(end($mtbdatas));
    ?>
	<form method=POST id='managerform' class="form-horizontal" action='includes/mtb/mtb_manager_edit.php?lang=<?php 
    echo $lang;
    ?>
'>
		<div class="control-group">
			<label class="control-label"><?php 
    lang('title');
    ?>
</label>
			<div class="controls">
				<input type="text" name='sval' value="<?php 
    echo $mtbdata->sval;
예제 #25
0
$userdatas = explode("\n", $userdata['output']);
$myprofile = json_decode(end($userdatas));
$err = '';
$arr['id'] = $_REQUEST['id'];
$arr['school_id'] = $myprofile->school_id;
$arr['years'] = $_REQUEST['years'];
$arr['from_year'] = $_REQUEST['from_year'];
$arr['to_year'] = $_REQUEST['to_year'];
$arr['term_num'] = 2;
$arr['term_duration'] = 4;
$arr['start_dt'] = "{$arr['from_year']}-09-05 00:00:00";
$djson = json_encode($arr);
//echo "<textarea>$djson</textarea>";
if ($err == "") {
    $posts = $djson;
    $sendapi = callapi($headers, $posts, '', "api/schools/years/update");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        if ($sendapi['http_code'] == 400) {
            $status[] = $sendapidata->developerMessage;
        } else {
            $status[] = $sendapi['http_code'];
        }
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
예제 #26
0
<?php

include "../../config.php";
ensure_permission('ttb');
ensure_role('mod,sadmin,admin');
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
    $class_id = $_REQUEST['table'];
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $headers[] = "Content-Type: application/json";
    $post = "xxx";
    $sendapi = callapi($headers, $post, '', "/api/timetables/delete/{$id}");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    print_r($sendapidata);
    //echo "api/timetables/delete  ---- $id";
    if ($sendapi['http_code'] != 200) {
        if ($sendapi['http_code'] == 400) {
            $status[] = $sendapidata->developerMessage;
        } else {
            $status[] = $sendapi['http_code'];
        }
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
예제 #27
0
\t\t\t\t<th>{$lang_title}</th>
\t\t\t\t<th>{$lang_location}</th>
\t\t\t\t<th>{$lang_level}</th>
\t\t\t\t<th>{$lang_year}</th>
\t\t\t\t<th>{$lang_startdate}</th>
\t\t\t\t<th>{$lang_enddate}</th>
\t\t\t\t<th>{$lang_teacher}</th>
\t\t\t\t<th>{$lang_status}</th>
\t\t\t\t<th>{$lang_edit}</th>
eot;
echo "</tr>\n\t\t</thead>";
echo "<tbody>";
$stsaip = callapi($headers, '', $gets, 'api/sys/sys_sts');
$stsdatas = explode("\n", $stsaip['output']);
$stsdata = json_decode(end($stsdatas));
$levaip = callapi($headers, '', $gets, 'api/masters/m_clslevel');
$levdatas = explode("\n", $levaip['output']);
$levdata = json_decode(end($levdatas));
foreach ($clsdata->list as $lists) {
    foreach ($stsdata->messageObject->list as $stslists) {
        if ($stslists->id == $lists->sts) {
            $status = $stslists->sval;
            break;
        }
    }
    foreach ($levdata->messageObject->list as $levlists) {
        if ($levlists->fval1 == $lists->level) {
            $level = $levlists->sval;
            break;
        }
    }
예제 #28
0
$arr['level'] = $_REQUEST['level'];
$arr['year_id'] = $_REQUEST['year_id'];
$djson = json_encode($arr);
$err = '';
foreach ($_REQUEST as $key => $r) {
    if ($key == 'submit') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $posts = $djson;
    //echo $posts;
    $sendapi = callapi($headers, $posts, '', "api/classes/update");
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    //print_r($sendapi);
    if ($sendapi['http_code'] != 200) {
        $status[] = $sendapi['http_code'];
        $status[] = $sendapidata->developerMessage;
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_classedited}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/cls/cls_manager_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
} else {
예제 #29
0
		
		
		<div class="control-group">
			<label class="control-label"><?php 
    lang('selectexam');
    ?>
</label>
			<div class="controls">
				
				<select name="ex_key" class="input-large">
					<?php 
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $sceapi = callapi($headers, '', $gets, "api/schools/exams");
    $scedatas = explode("\n", $sceapi['output']);
    $scedata = json_decode(end($scedatas));
    foreach ($scedata->messageObject as $lists) {
        echo "<option {$selected} value='{$lists->ex_key}'>{$lists->ex_displayname}</option>";
    }
    ?>
				</select>
			</div>
		</div>
		
		<div class="form-actions">
			<button type="submit" class="btn btn-info" name="submit"><i class="icon-search"></i> <?php 
    lang('view');
    ?>
</button>
예제 #30
0
    if ($key == 'submit') {
        continue;
    }
    if ($r == '') {
        $err = "{$lang_pleasefill} {$key}";
    }
}
if ($err == "") {
    $headers = array();
    $auth_key = $_SESSION[$config_session]['auth_key'];
    $headers[] = "auth_key: {$auth_key}";
    $headers[] = "api_key: TEST_API_KEY";
    $headers[] = "Content-Type: application/json";
    $posts = $djson;
    //$posts = '{"id":2,"school_id":1,"class_id":1,"exam_id":null,"exam_name":null,"exam_type":1,"exam_dt":null,"subject_id":2,"teacher_id":null,"student_id":14,"student_name":"Student 14","notice":"Normal exam","sresult":"1","term_id":1,"exam_month":9,"exam_year":2016,"term_val":null,"sch_year_id":0,"subject":"Ly","teacher":null,"term":"HK 1"}';
    $sendapi = callapi($headers, $posts, '', 'api/attendances/create');
    $sendapidatas = explode("\n", $sendapi['output']);
    $sendapidata = json_decode(end($sendapidatas));
    if ($sendapi['http_code'] != 200) {
        if ($sendapi['http_code'] == 400) {
            $status[] = $sendapidata->developerMessage;
        } else {
            $status[] = $sendapi['http_code'];
        }
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> Absent for Reason: {$notice}. Done!</span>\n\t\t\t";