Esempio n. 1
0
         $temp['rejection'] = $_cutting['rejection'];
         $totalRejection += $_cutting['rejection'] * 1;
         $temp['item'] = $_cutting['item'];
         $temp['job_date'] = $_cutting['job_date'];
         $temp['waste'] = $_cutting['waste'];
         $totalWaste += $_cutting['waste'] * 1;
         $arr[] = $temp;
     }
     $prop['totalNet'] = $totalNet;
     $prop['totalQty'] = $totalQty;
     $prop['totalHc'] = $totalHc;
     $prop['totalRejection'] = $totalRejection;
     $prop['totalWaste'] = $totalWaste;
 } else {
     if ($StringUtils->equalsPost('subtab', 'delivery')) {
         $_deliverys = ias_db_query("SELECT * FROM ( " . "  SELECT `dispatch_no`, " . "         `item`, " . "         `unit`, " . "         `tr_no`, " . "         `no_of_bags`, " . "         `qty`, " . "         `gross`, " . "         `core`, " . "         `job_date`, " . "         case unit when 'PCS' then round((qty * no_of_bags) - core,2) " . "\t\t\telse " . "\t\t\t\t round((gross-core),2) " . "\t\t\tEND as total  " . "    FROM `{$CONFIG['TABLE_PREFIX']}item_dispatch` " . "   WHERE `prod_id` = {$prodid} " . ") x WHERE 1=1 {$wh} ORDER BY `dispatch_no` DESC");
         $deliverys = ias_db_fetch_rowset($_deliverys);
         mysql_free_result($_deliverys);
         $totalTotal = 0;
         foreach ($deliverys as $_delivery) {
             $temp = array();
             $temp['dispatch_no'] = $_delivery['dispatch_no'];
             $temp['item'] = $_delivery['item'];
             $temp['unit'] = $_delivery['unit'];
             $temp['tr_no'] = $_delivery['tr_no'];
             $temp['no_of_bags'] = $_delivery['no_of_bags'];
             $temp['qty'] = $_delivery['qty'];
             $temp['gross'] = $_delivery['gross'];
             $temp['core'] = $_delivery['core'];
             $temp['job_date'] = $_delivery['job_date'];
             $temp['total'] = $_delivery['total'];
Esempio n. 2
0
<?php

require_once 'db.php';
user_get_profile();
if (!isset($USER['id'])) {
    echo "You are not authorized to view this page";
    exit(0);
}
if (isset($_GET['jobcard']) && !isset($_GET['prodid'])) {
    $_production = ias_db_query("SELECT `prod_id` FROM `{$CONFIG['TABLE_PREFIX']}production_master` WHERE `job_card` = {$_GET['jobcard']}");
    $production = ias_db_fetch_row($_production);
    mysql_free_result($_production);
    if ($production === false) {
        ias_db_query("INSERT INTO `{$CONFIG['TABLE_PREFIX']}production_master`(`prod_id`, `job_card`) VALUES(NULL, '{$_GET['jobcard']}')");
        $id = mysql_insert_id();
        header("Location: production.php?jobcard={$_GET['jobcard']}&prodid={$id}");
    } else {
        header("Location: production.php?jobcard={$_GET['jobcard']}&prodid={$production['prod_id']}");
    }
}
$patchId = mysql_result(mysql_query("SELECT max(id) FROM {$CONFIG['TABLE_PREFIX']}`patch`"), 0, 0);
$subPatchId = mysql_result(mysql_query("SELECT max(id) FROM {$CONFIG['TABLE_PREFIX']}`patchoper`"), 0, 0);
?>
<html>
<head>
<title> :: <?php 
echo $CONFIG['APP_TITLE'];
?>
 :: </title>
<link href="style.css" rel="stylesheet" type="text/css">
		constraintoviewport : true,
		buttons : [ { text:"Find",  handler:handleCutSearchSubmit, isDefault:true },
				    { text:"Reset", handler:handleCutSearchReset },
					{ text:"Close", handler:handleCancel } ]
	});
	dialogCuttingSearch.callback = { success: handleSuccess, failure: handleFailure };
	dialogCuttingSearch.validate = handleCutSearchSubmit;
	dialogCuttingSearch.render();
	
	function btnSearchCuttingClick(p_oEvent) {
		dialogCuttingSearch.show();
	}
	var btnSearchCutting = new YAHOO.widget.Button("btnSearchCutting", { onclick: { fn: btnSearchCuttingClick } });
	
	var cutItemItems = [<?php 
$_production = ias_db_query("SELECT DISTINCT `item` FROM `{$CONFIG['TABLE_PREFIX']}cutting_production`");
$productions = ias_db_fetch_rowset($_production);
mysql_free_result($_production);
$first = true;
foreach ($productions as $production) {
    if (!$first) {
        print ",";
    }
    if ($first) {
        $first = false;
    }
    print "\"{$production['item']}\"";
}
?>
	];
	
Esempio n. 4
0
<button type="button" id="btnAddUser" name="btnAddUser" value="Add">Add</button>
<div id="markupUser">
	<table id="tableUser">
		<tbody><?php 
$uindex = 0;
$_users = ias_db_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}users` ORDER BY `name` asc");
$users = ias_db_fetch_rowset($_users);
mysql_free_result($_users);
foreach ($users as $_user) {
    ?>
			<tr>
			  <td><?php 
    echo $_user['id'];
    ?>
</td>
			  <td><?php 
    echo $_user['name'];
    ?>
</td>
			  <td><?php 
    echo $_user['user'];
    ?>
</td>
			  <td><?php 
    echo $_user['email'];
    ?>
</td>
			  <td><?php 
    echo $_user['lastvisit'];
    ?>
</td>
Esempio n. 5
0
/**
 * user_save_profile()
 *
 * Save the user profile in a cookie
 *
 **/
function user_save_profile($update = true)
{
    global $CONFIG, $USER;
    $data = base64_encode(serialize($USER));
    setcookie($CONFIG['cookie_name'] . '_data', $data, time() + 86400 * 30, $CONFIG['cookie_path']);
    if ($update && isset($USER['id'])) {
        ias_db_query("UPDATE `{$CONFIG['TABLE_PREFIX']}users` SET `lastvisit` = now() WHERE `id` = '{$USER['id']}'");
    }
}
Esempio n. 6
0
<button type="button" id="btnAddOption" name="btnAddOption" value="Add">Add</button>
<div id="markupOption">
	<table id="tableOption">
		<tbody><?php 
$_options = ias_db_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}options` ORDER BY `name` asc");
$options = ias_db_fetch_rowset($_options);
mysql_free_result($_options);
foreach ($options as $_option) {
    ?>
			<tr>
			  <td><?php 
    echo $_option['id'];
    ?>
</td>
			  <td><?php 
    echo $_option['name'];
    ?>
</td>
			  <td><?php 
    echo $_option['value'];
    ?>
</td>
			</tr><?php 
}
?>
		</tbody>
	</table>
</div>
<div id="dialogOption">
	<div class="hd">Please enter the following information.</div>
	<div class="bd">
Esempio n. 7
0
<?php

require_once 'db.php';
$error = "";
if (isset($_POST['form'])) {
    $_users = ias_db_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}users` WHERE `user` = '{$_POST['user']}' AND `pass` = MD5('{$_POST['pass']}') AND `active` = 'Y'");
    $users = ias_db_fetch_row($_users);
    mysql_free_result($_users);
    if (!$users) {
        $error = "You are not authorized to view this page<br/>You have specified invalid authentication information";
    } else {
        if ($users['iprestrict'] == 'Y') {
            $_ips = ias_db_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}ips` WHERE `userid` = '{$users['id']}' AND `ip` = '{$raw_ip}'");
            $ips = ias_db_fetch_row($_ips);
            mysql_free_result($_ips);
            if (!$ips) {
                $error = "You are not authorized to view this page<br/>You are logging in from restricted IP address ({$raw_ip})";
            }
        }
        if (strlen($error) < 1) {
            list($sh, $sm, $ss) = explode(':', $CONFIG['time_start']);
            list($ch, $cm, $cs) = explode(':', myDST());
            list($eh, $em, $es) = explode(':', $CONFIG['time_end']);
            $start = $sh * 60 * 60 + $sm * 60 + $ss;
            $current = $ch * 60 * 60 + $cm * 60 + $cs;
            $end = $eh * 60 * 60 + $em * 60 + $es;
            if ($start == 0) {
                $start = $current;
                $end = $current;
                $users['timerestrict'] = 'N';
            }
			<input type="hidden" id="additiveaction" name="additiveaction" value="u" />
			<input type="hidden" id="add_ext_pro_id" name="add_ext_pro_id" value="" />
			<table cellpadding="1" cellspacing="1" border="0" width="100%">
				<colgroup>
					<col width="8%" />
					<col width="92%" />
				</colgroup>
				<tbody>
					<tr>
						<td>ID:&nbsp;</td>
						<td><input type="text" id="add_ext_add_list_no" name="add_ext_add_list_no" value="" readonly style="width:100%" class="pread" /></td>
					</tr>
					<tr>
						<td>Item:&nbsp;</td>
						<td><select size="1" id="add_item_name" name="add_item_name" style="width:100%"><?php 
$_production = ias_db_query("SELECT DISTINCT `item_name` FROM `{$CONFIG['TABLE_PREFIX']}exturder_additive_list`");
$productions = ias_db_fetch_rowset($_production);
mysql_free_result($_production);
foreach ($productions as $production) {
    ?>
							<option value="<?php 
    echo $production['item_name'];
    ?>
"><?php 
    echo $production['item_name'];
    ?>
</option><?php 
}
?>
						</select></td>
					</tr>
Esempio n. 9
0
<?php

require_once 'db.php';
if (isset($_GET['query'])) {
    header('Content-type: text/plain');
    $sql = "SELECT pm.job_card, DATE_FORMAT(pm.order_date, '%d-%b-%y') order_date, pm.party_name, DATE_FORMAT(ep.job_date, '%d-%b-%y') job_date, ep.item " . "FROM {$CONFIG['TABLE_PREFIX']}production_master pm INNER JOIN {$CONFIG['TABLE_PREFIX']}{$_GET['tab']} ep ON ep.prod_id = pm.prod_id " . "WHERE LOWER(ep.item) LIKE LOWER('{$_GET['query']}%') ORDER BY ep.job_date DESC";
    $_production = ias_db_query($sql);
    $productions = ias_db_fetch_rowset($_production);
    mysql_free_result($_production);
    foreach ($productions as $production) {
        print "{$production['job_card']},{$production['order_date']},{$production['party_name']},{$production['job_date']},{$production['item']}\n";
    }
}
Esempio n. 10
0
<?php

require_once 'db.php';
$json = array();
$_additives = ias_db_query("SELECT * FROM `{$CONFIG['TABLE_PREFIX']}exturder_additive_list` WHERE `ext_pro_id` = {$_GET['ext_pro_id']}");
$additives = ias_db_fetch_rowset($_additives);
mysql_free_result($_additives);
foreach ($additives as $_addlist) {
    $json_array = array();
    $json_array['ext_add_list_no'] = $_addlist['ext_add_list_no'];
    $json_array['item_name'] = $_addlist['item_name'];
    $json_array['item_qty'] = $_addlist['item_qty'];
    $json[] = $json_array;
}
echo JSON_print($json);
Esempio n. 11
0
            ias_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}patch(id, descr, ptime) VALUES ('" . $patches[0]['id'] . "', '" . $patches[0]['description'] . "', now())");
            foreach ($statements as $stat) {
                ias_db_query("INSERT INTO `patchoper`(id, patch, ptype, descr) VALUES(null, " . $patches[0]['id'] . ", 'S', '" . $stat['description'] . "')");
            }
        } else {
            if ($id - 1 < 0) {
            } else {
                $patch = $patches[$id - 1];
                $statements = $patch['statements'];
                if ($statements != NULL) {
                    foreach ($statements as $stat) {
                        $result = ias_safedb_query($stat['operation']);
                        if ($result) {
                            echo "<div style=\"color:green\">Patching Successfull</div>";
                        } else {
                            echo "<div style=\"color:red\">" . mysql_error() . "</div>";
                        }
                        if ($result) {
                            ias_db_query("INSERT INTO `patchoper`(id, patch, ptype, descr) VALUES(null, " . $patch['id'] . ", 'S', '" . $stat['description'] . "')");
                        }
                    }
                    ias_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}patch(id, descr, ptime) VALUES ('" . $patch['id'] . "', '" . $patch['description'] . "', now())");
                }
            }
        }
    }
} else {
    dump($_POST);
    $patches = parsePatches();
    dump($patches);
}
Esempio n. 12
0
		constraintoviewport : true,
		buttons : [ { text:"Find",  handler:handleDelSearchSubmit, isDefault:true },
				    { text:"Reset", handler:handleDelSearchReset },
					{ text:"Close", handler:handleCancel } ]
	});
	dialogDeliverySearch.callback = { success: handleSuccess, failure: handleFailure };
	dialogDeliverySearch.validate = handleDelSearchSubmit;
	dialogDeliverySearch.render();
	
	function btnSearchDeliveryClick(p_oEvent) {
		dialogDeliverySearch.show();
	}
	var btnSearchDelivery = new YAHOO.widget.Button("btnSearchDelivery", { onclick: { fn: btnSearchDeliveryClick } });
	
	var delItemItems = [<?php 
$_production = ias_db_query("SELECT DISTINCT `item` FROM `{$CONFIG['TABLE_PREFIX']}item_dispatch`");
$productions = ias_db_fetch_rowset($_production);
mysql_free_result($_production);
$first = true;
foreach ($productions as $production) {
    if (!$first) {
        print ",";
    }
    if ($first) {
        $first = false;
    }
    print "\"{$production['item']}\"";
}
?>
	];
	
Esempio n. 13
0
			<input type="hidden" name="form" value="ip">
			<input type="hidden" id="ipaction" name="ipaction" value="u">
			<table cellpadding="1" cellspacing="1" border="0" width="100%">
				<colgroup>
					<col width="8%" />
					<col width="92%" />
				</colgroup>
				<tbody>
					<tr>
						<td>ID:&nbsp;</td>
						<td><input type="text" id="ip_id" name="ip_id" value="" readonly style="width:100%" class="pread" /></td>
					</tr>
                    <tr>
						<td>User:&nbsp;</td>
						<td><select size="1" id="ip_user" name="ip_user" style="width:100%" tabindex="1"><?php 
$_users = ias_db_query("SELECT id, name FROM `{$CONFIG['TABLE_PREFIX']}users` WHERE `active` = 'Y' ORDER BY `name` asc");
$users = ias_db_fetch_rowset($_users);
mysql_free_result($_users);
foreach ($users as $_user) {
    ?>
                            <option value="<?php 
    echo $_user['id'];
    ?>
"><?php 
    echo $_user['name'];
    ?>
</option><?php 
}
?>
						</select></td>
					</tr>
Esempio n. 14
0
<?php

$jobcard = '-1';
$prodid = '-1';
if (isset($_GET['jobcard'])) {
    $jobcard = $_GET['jobcard'];
}
if (isset($_GET['prodid'])) {
    $prodid = $_GET['prodid'];
}
$_production = ias_db_query("SELECT `prod_id`, " . "       date_format(`order_date`, '%Y-%m-%d') order_date, " . "       date_format(`order_date`, '%b %d, %Y') order_date_text, " . "       date_format(`delivery_date`, '%Y-%m-%d') delivery_date, " . "       date_format(`delivery_date`, '%b %d, %Y') delivery_date_text, " . "       `party_name`, " . "       `production_item`, " . "       `item_size`, " . "       `reference`, " . "       `material`, " . "       `item_thickness`, " . "       `item_packing`, " . "       `remarks`, " . "       `item_name`, " . "       `lemination`, " . "       `min_order`, " . "       `max_weight`, " . "       `max_count`, " . "       `job_card` " . "FROM `{$CONFIG['TABLE_PREFIX']}production_master` WHERE `job_card` = {$jobcard}");
$production = ias_db_fetch_row($_production);
mysql_free_result($_production);
$isReadOnly = $StringUtils->equalsGet('edit', 'false');
?>
<div id="dialogLoading">
	<div class="hd">Loading, please wait...</div>
	<div class="bd">
		<img src="images/wait.gif" width="220" height="19" alt="Loading" border="0" />
	</div>
</div>
<div id="dialogYesNo">
	<div class="hd">Job Card not found</div>
	<div class="bd">
		Specified job card was not found.<br/>
		Do you want to continue, and create a new Job Card (<span id="dialogYesNoSpanJobCard"></span>)?
	</div>
</div>
<div align="left">
<script type="text/javascript">
	var dialogLoading = new YAHOO.widget.Dialog("dialogLoading", {