コード例 #1
0
ファイル: show.php プロジェクト: jquerubim10/laudos
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new ValorExame($_GET[id]);
		//$o->setDependences();
		//util::prt("", get_class_methods($o));
		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 	$o->get($campo));
		}
		$exa = new Exame($o->get("exa_id"));
		$tpl->assign("exa_nome", 	$exa->get("exa_nome"));

		$con = new Convenio($o->get("con_id"));
		$tpl->assign("con_nome", 	$con->get("con_nome"));

		$hos = new Hospital($con->get("hos_id"));
		$tpl->assign("hos_nome", 	$hos->get("hos_nome"));
		
		if ($_GET[del] == "1" || $_POST[del] == "1"){
			if ($o->delete($_GET[delete_dependences])){
				Js::goto(array("url" => "index.php?s=valor_exame"));
			} else {
				$dep = $o->getDependences();
				if (sizeof($dep)){
					$tpl->assign("dependences", 	$dep);
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=convenio"));
	}
コード例 #2
0
ファイル: update.php プロジェクト: jquerubim10/laudos
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new ValorExame($_GET[id]);

		$con_id = (empty($_POST["con_id"]) ? $o->get("con_id") : $_POST["con_id"]);
		if ($con_id){
			$con = new Convenio($con_id);
			$tpl->assign("con_valor_ch", 	$con->get("con_valor_ch"));
			$tpl->assign("con_valor_filme",	$con->get("con_valor_filme"));
		}

		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 		(empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo]));
			$o->set($campo,				$_POST[$campo]);
		}
		$tpl->assign("vet_exames", 				Exame::getOptions());
		$tpl->assign("vet_convenios", 			Convenio::getOptions());
		
		if ($_POST[form] == "ok"){
			if ($o->update()){
				Js::goto(array("url" => "index.php?s=valor_exame"));
			} else {
				foreach($o->errors as $campo => $erro){
					$tpl->assign($campo."_erro", $erro);
					$tpl->assign($campo, "");
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=valor_exame"));