Example #1
0
function have_right($right)
{
    $self = $_SERVER['PHP_SELF'];
    if (isLive()) {
        $index1 = strpos($self, '/clients/');
        $index2 = strpos($self, '/', $index1 + 9);
        $client = substr($self, $index1 + 9, $index2 - ($index1 + 9));
        $self = str_replace("/clients/{$client}/", '../', $self);
    } else {
        $self = str_replace('/corpus/', '../', $self);
    }
    return have_right_on($right, $self);
}
Example #2
0
function dumpFile(&$var, $info = FALSE, $mode = 'a')
{
    if (isLive()) {
        // do not create dumps for LIVE application
        return;
    }
    ob_start();
    dump($var, $info);
    $out = ob_get_contents();
    ob_end_clean();
    $fp = fopen('dump.htm', $mode);
    if ($mode == 'w') {
        $str = "<html><head><title>DUMP</title></head><body>";
        fwrite($fp, $str);
    }
    fwrite($fp, $out);
    fclose($fp);
}
Example #3
0
            }
            echo $sql . "<br/>";
            $result = mysql_query($sql) or die("Couldn t execute query." . mysql_error());
            $_key = -1;
            if (strlen($voucher_detail_id) > 0) {
                $_key = $voucher_detail_id;
            } else {
                $_key = mysql_insert_id();
            }
            $data["id_" . $i] = $_key;
        }
    }
    /* start auditing on add, update, delete */
    $voucher_id = $parent_key;
    $voucher_aud_id = d_mysql_query("INSERT INTO voucher_master_aud SELECT NULL, vm.*, '{$oper}', {$_SESSION['user_id']}, now() FROM voucher_master vm WHERE vm.voucher_id = {$voucher_id}", true);
    d_mysql_query("INSERT INTO voucher_detail_aud SELECT NULL, vd.*, {$voucher_aud_id} FROM voucher_detail vd WHERE vd.voucher_id = {$voucher_id}");
    /*  end  auditing on add, update, delete */
}
$json = new Services_JSON();
$output = $json->encode($data);
print $output;
$out = ob_get_contents();
ob_end_clean();
if (!isLive()) {
    $fp = fopen('voucher_cud.htm', 'w');
    fwrite($fp, "<html><head><title>VOUCHER CUD</title></head><body>");
    fwrite($fp, $out);
    fwrite($fp, "</body></html>");
    fclose($fp);
}
print $output;
Example #4
0
				centerFrame();
				setTimeout('checkDcChallan()', delay);
			},
			failure: function(o) { }
		};
		var transaction = YAHOO.util.Connect.asyncRequest('GET', '../transaction/dc.php?user=<?php 
echo $_SESSION['user_id'];
?>
', callback);
	}
</script>
<script type="text/javascript">
	jQuery(document).ready(function(){
		$("#gears").hide();
		<?php 
if (isLive()) {
    ?>
_checkHtml5Db();<?php 
}
?>
	});
	
	$("#btnGear").click(function() {
		document.location.href = '../transaction/gears.php';
		return false;
	});
	
	function _checkHtml5Db() {
		if (document.location.href.endsWith('gears.php')) {
            //do not check if already on gears.php page
        } else {
Example #5
0
$cols = getDBCell("pgn_gallery", "COLS", "GALLERY_ID = " . $gallery);
$imFolder = getDBCell("pgn_gallery", "IMAGE_FOLDER_ID", "GALLERY_ID = " . $gallery);
// write header...
echo "<gallery rows='{$cols}' cols='{$rows}'>\n";
// prepare conent..
$imagePGNId = getDBCell("modules", "MODULE_ID", "UPPER(MODULE_NAME) ='IMAGE'");
$imageList = createDBCArray("content", "CID", "MODULE_ID = {$imagePGNId} AND CATEGORY_ID = {$imFolder}");
if ($live) {
    $impath = $c["livefilesdocroot"];
} else {
    $impath = $c["devfilesdocroot"];
    //todo: versioning.
}
// create content-list.
for ($i = 0; $i < count($imageList); $i++) {
    $cid = $imageList[$i];
    if ($live == isLive($cid)) {
        $fkid = getDBCell("content_variations", "FK_ID", "CID = {$cid} AND DELETED=0 AND VARIATION_ID = {$variation}");
        $filename = getDBCell("pgn_image", "FILENAME", "FKID={$fkid}");
        echo "\t<photo furl='{$impath}" . $filename . "' purl='{$impath}" . "t" . $filename . "' comment=''/>\n";
    }
}
// write footer
echo "</gallery>\n";
function isLive($id)
{
    if (getDBCell("state_translation", "OUT_ID", "OUT_ID={$id}") != "") {
        return true;
    }
    return false;
}
Example #6
0
function currentServiceLink()
{
    $output = false;
    if (isLive()) {
        $output = site_url() . '/live';
    } else {
        $output = site_url() . '/watch';
    }
    return $output;
}