Exemplo n.º 1
0
//	Date		: 94.08
//-----------------------------
require_once '../header.inc.php';
require_once 'contract.class.php';
require_once '../templates/templates.class.php';
$CntObj = new CNT_contracts($_REQUEST['ContractID']);
$ContractRecord = CNT_contracts::Get(false, " AND ContractID=?", array($CntObj->ContractID));
$ContractRecord = $ContractRecord->fetch();
$temp = CNT_TemplateItems::Get(" AND TemplateID in(0,?)", array($CntObj->TemplateID));
$TplItems = $temp->fetchAll();
$TplItemsStore = array();
foreach ($TplItems as $it) {
    $TplItemsStore[$it['TemplateItemID']] = $it;
}
$res = explode(CNTconfig::TplItemSeperator, $CntObj->content);
$CntItems = CNT_ContractItems::GetContractItems($CntObj->ContractID);
$ValuesStore = array();
foreach ($CntItems as $it) {
    $ValuesStore[$it['TemplateItemID']] = $it['ItemValue'];
}
if (substr($CntObj->content, 0, 3) == CNTconfig::TplItemSeperator) {
    $res = array_merge(array(''), $res);
}
$st = '';
for ($i = 0; $i < count($res); $i++) {
    if ($i % 2 != 0) {
        if (isset($ValuesStore[$res[$i]])) {
            switch ($TplItemsStore[$res[$i]]["ItemType"]) {
                case 'shdatefield':
                    $st .= DateModules::miladi_to_shamsi($ValuesStore[$res[$i]]);
                    break;
Exemplo n.º 2
0
function GetContractItems()
{
    $res = CNT_ContractItems::GetContractItems($_REQUEST['ContractID']);
    echo dataReader::getJsonData($res, count($res), $_GET["callback"]);
    die;
}