Ejemplo n.º 1
0
                }
            }
        }
        break;
    case 'save_answer':
        if ($_REQUEST['quest_detail_id'] == '') {
            save_answer($user_id, $quest_id1, $add_id);
        } else {
            update_answer($quest_detail_id, $quest_id1, $quest_id);
        }
        break;
    case 'disable':
        if ($quest_detail_id != '') {
            disable_det($quest_detail_id);
        } else {
            disable($quest_id);
        }
        break;
    case 'get_scen_cat':
        $data['cat'] = GetLeCat($_REQUEST['cat_id'], '');
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Category Functions
* ******************************
*/
function save($user_id, $name, $cat, $le_cat)
Ejemplo n.º 2
0
        $l_name = $_REQUEST['cln'];
        $cadre_position = $_REQUEST['cp'];
        $cadre_contact = $_REQUEST['cc'];
        $cadre_phone = $_REQUEST['cph'];
        $cadre_m_phone = $_REQUEST['cmp'];
        $cadre_sale = $_REQUEST['cs'];
        $cadre_limit = $_REQUEST['cl'];
        if ($cadre_id == '') {
            AddCadre($partner_id, $user_id, $person_id, $f_name, $l_name, $cadre_position, $cadre_phone, $cadre_m_phone, $cadre_contact, $cadre_sale, $cadre_limit);
        } else {
            SaveCadre($cadre_id, $partner_id, $user_id, $person_id, $f_name, $l_name, $cadre_position, $cadre_phone, $cadre_m_phone, $cadre_contact, $cadre_sale, $cadre_limit);
        }
        break;
    case 'disable':
        $cadre_id = $_REQUEST['id'];
        disable($cadre_id);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Partner Cadre Functions
 * ******************************
 */
function AddCadre($partner_id, $user_id, $person_id, $f_name, $l_name, $cadre_position, $cadre_phone, $cadre_m_phone, $cadre_contact, $cadre_sale, $cadre_limit)
{
    mysql_query("INSERT INTO `partner_persons`\r\n\t\t\t\t\t(`partner_id`, `user_id`, `person_id`,`f_name`, `l_name`, `position`, `phone`, `m_phone`, `chontacter`, `sale_rate`, `sale_limit`) \r\n\t\t\t\t VALUES\r\n\t\t\t\t \t({$partner_id}, {$user_id}, '{$person_id}', '{$f_name}', '{$l_name}', '{$cadre_position}', '{$cadre_phone}', '{$cadre_m_phone}', {$cadre_contact}, '{$cadre_sale}', '{$cadre_limit}')");
    global $log;
    $log->setInsertLog('partner_persons');
Ejemplo n.º 3
0
function judge($row)
{
    global $EXITCODES, $myhost, $options, $workdirpath, $exitsignalled, $gracefulexitsignalled;
    // Set configuration variables for called programs
    putenv('USE_CHROOT=' . (USE_CHROOT ? '1' : ''));
    putenv('SCRIPTTIMELIMIT=' . dbconfig_get_rest('script_timelimit'));
    putenv('SCRIPTMEMLIMIT=' . dbconfig_get_rest('script_memory_limit'));
    putenv('SCRIPTFILELIMIT=' . dbconfig_get_rest('script_filesize_limit'));
    putenv('MEMLIMIT=' . $row['memlimit']);
    putenv('FILELIMIT=' . $row['outputlimit']);
    putenv('PROCLIMIT=' . dbconfig_get_rest('process_limit'));
    $cpuset_opt = "";
    if (isset($options['daemonid'])) {
        $cpuset_opt = "-n {$options['daemonid']}";
    }
    // create workdir for judging
    $workdir = "{$workdirpath}/c{$row['cid']}-s{$row['submitid']}-j{$row['judgingid']}";
    logmsg(LOG_INFO, "Working directory: {$workdir}");
    // If a database gets reset without removing the judging
    // directories, we might hit an old directory: rename it.
    if (file_exists($workdir)) {
        $oldworkdir = $workdir . '-old-' . getmypid() . '-' . strftime('%Y-%m-%d_%H:%M');
        if (!rename($workdir, $oldworkdir)) {
            error("Could not rename stale working directory to '{$oldworkdir}'");
        }
        @chmod($oldworkdir, 0700);
        warning("Found stale working directory; renamed to '{$oldworkdir}'");
    }
    system("mkdir -p '{$workdir}/compile'", $retval);
    if ($retval != 0) {
        error("Could not create '{$workdir}/compile'");
    }
    // Make sure the workdir is accessible for the domjudge-run user.
    // Will be revoked again after this run finished.
    chmod($workdir, 0755);
    if (!chdir($workdir)) {
        error("Could not chdir to '{$workdir}'");
    }
    // Get the source code from the DB and store in local file(s)
    $sources = request('submission_files', 'GET', 'id=' . urlencode($row['submitid']));
    $sources = dj_json_decode($sources);
    $files = array();
    foreach ($sources as $source) {
        $srcfile = "{$workdir}/compile/{$source['filename']}";
        $files[] = "'{$source['filename']}'";
        if (file_put_contents($srcfile, base64_decode($source['content'])) === FALSE) {
            error("Could not create {$srcfile}");
        }
    }
    if (count($files) == 0) {
        error("No submission files could be downloaded.");
    }
    if (empty($row['compile_script'])) {
        error("No compile script specified for language " . $row['langid'] . ".");
    }
    list($execrunpath, $error) = fetch_executable($workdirpath, $row['compile_script'], $row['compile_script_md5sum']);
    if (isset($error)) {
        logmsg(LOG_ERR, "fetching executable failed for compile script '" . $row['compile_script'] . "':" . $error);
        disable('language', 'langid', $row['langid'], $error, $row['judgingid'], $row['cid']);
        return;
    }
    // Compile the program.
    system(LIBJUDGEDIR . "/compile.sh {$cpuset_opt} '{$execrunpath}' '{$workdir}' " . implode(' ', $files), $retval);
    // what does the exitcode mean?
    if (!isset($EXITCODES[$retval])) {
        alert('error');
        logmsg(LOG_ERR, "Unknown exitcode from compile.sh for s{$row['submitid']}: {$retval}");
        $description = "compile script '" . $row['compile_script'] . "' returned exit code " . $retval;
        disable('language', 'langid', $row['langid'], $description, $row['judgingid'], $row['cid']);
        // revoke readablity for domjudge-run user to this workdir
        chmod($workdir, 0700);
        return;
    }
    $compile_success = $EXITCODES[$retval] != 'compiler-error';
    // pop the compilation result back into the judging table
    request('judgings/' . urlencode($row['judgingid']), 'PUT', 'judgehost=' . urlencode($myhost) . '&compile_success=' . $compile_success . '&output_compile=' . rest_encode_file($workdir . '/compile.out'));
    // compile error: our job here is done
    if (!$compile_success) {
        // revoke readablity for domjudge-run user to this workdir
        chmod($workdir, 0700);
        logmsg(LOG_NOTICE, "Judging s{$row['submitid']}/j{$row['judgingid']}: compile error");
        return;
    }
    // Optionally create chroot environment
    if (USE_CHROOT && CHROOT_SCRIPT) {
        logmsg(LOG_INFO, "executing chroot script: '" . CHROOT_SCRIPT . " start'");
        system(LIBJUDGEDIR . '/' . CHROOT_SCRIPT . ' start', $retval);
        if ($retval != 0) {
            error("chroot script exited with exitcode {$retval}");
        }
    }
    // Query timelimit overshoot here once for all testcases
    $overshoot = dbconfig_get_rest('timelimit_overshoot');
    $totalcases = 0;
    while (TRUE) {
        // Check whether we have received an exit signal(but not a graceful exit signal)
        if (function_exists('pcntl_signal_dispatch')) {
            pcntl_signal_dispatch();
        }
        if ($exitsignalled && !$gracefulexitsignalled) {
            logmsg(LOG_NOTICE, "Received HARD exit signal, aborting current judging.");
            // Make sure the domserver knows that we didn't finish this judging
            $unfinished = request('judgehosts', 'POST', 'hostname=' . urlencode($myhost));
            $unfinished = dj_json_decode($unfinished);
            foreach ($unfinished as $jud) {
                logmsg(LOG_WARNING, "Aborted judging j" . $jud['judgingid'] . " due to signal");
            }
            // Break, not exit so we cleanup nicely
            break;
        }
        // get the next testcase
        $testcase = request('testcases', 'GET', 'judgingid=' . urlencode($row['judgingid']));
        if (json_decode($testcase) === NULL) {
            $disabled = json_encode(array('kind' => 'problem', 'probid' => $row['probid']));
            $judgehostlog = read_judgehostlog();
            $error_id = request('internal_error', 'POST', 'judgingid=' . urlencode($row['judgingid']) . '&cid=' . urlencode($row['cid']) . '&description=' . urlencode("no test cases found") . '&judgehostlog=' . urlencode(base64_encode($judgehostlog)) . '&disabled=' . urlencode($disabled));
            logmsg(LOG_ERR, "No testcases found for p{$row['probid']} => internal error " . $error_id);
            break;
        }
        $tc = dj_json_decode($testcase);
        // empty means: no more testcases for this judging.
        if (empty($tc)) {
            break;
        }
        $totalcases++;
        logmsg(LOG_DEBUG, "Running testcase {$tc['rank']}...");
        $testcasedir = $workdir . "/testcase" . sprintf('%03d', $tc['rank']);
        // Get both in- and output files, only if we didn't have them already.
        $tcfile = array();
        $fetched = array();
        foreach (array('input', 'output') as $inout) {
            $tcfile[$inout] = "{$workdirpath}/testcase/testcase.{$tc['probid']}.{$tc['rank']}." . $tc['md5sum_' . $inout] . "." . substr($inout, 0, -3);
            if (!file_exists($tcfile[$inout])) {
                $content = request('testcase_files', 'GET', 'testcaseid=' . urlencode($tc['testcaseid']) . '&' . $inout);
                $content = base64_decode(dj_json_decode($content));
                if (file_put_contents($tcfile[$inout] . ".new", $content) === FALSE) {
                    error("Could not create {$tcfile[$inout]}.new");
                }
                unset($content);
                if (md5_file("{$tcfile[$inout]}.new") === $tc['md5sum_' . $inout]) {
                    rename("{$tcfile[$inout]}.new", $tcfile[$inout]);
                } else {
                    error("File corrupted during download.");
                }
                $fetched[] = $inout;
            }
            // sanity check (NOTE: performance impact is negligible with 5
            // testcases and total 3.3 MB of data)
            if (md5_file($tcfile[$inout]) !== $tc['md5sum_' . $inout]) {
                error("File corrupted: md5sum mismatch: " . $tcfile[$inout]);
            }
        }
        // Only log downloading input and/or output testdata once.
        if (count($fetched) > 0) {
            logmsg(LOG_INFO, "Fetched new " . implode($fetched, ',') . " testcase {$tc['rank']} for problem p{$tc['probid']}");
        }
        // Copy program with all possible additional files to testcase
        // dir. Use hardlinks to preserve space with big executables.
        $programdir = $testcasedir . '/execdir';
        system("mkdir -p '{$programdir}'", $retval);
        if ($retval != 0) {
            error("Could not create directory '{$programdir}'");
        }
        system("cp -PRl '{$workdir}'/compile/* '{$programdir}'", $retval);
        if ($retval != 0) {
            error("Could not copy program to '{$programdir}'");
        }
        // do the actual test-run
        $hardtimelimit = $row['maxruntime'] + overshoot_time($row['maxruntime'], $overshoot);
        list($compare_runpath, $error) = fetch_executable($workdirpath, $row['compare'], $row['compare_md5sum']);
        if (isset($error)) {
            logmsg(LOG_ERR, "fetching executable failed for compare script '" . $row['compare'] . "':" . $error);
            disable('problem', 'probid', $row['probid'], $error, $row['judgingid'], $row['cid']);
            return;
        }
        list($run_runpath, $error) = fetch_executable($workdirpath, $row['run'], $row['run_md5sum']);
        if (isset($error)) {
            logmsg(LOG_ERR, "fetching executable failed for run script '" . $row['run'] . "':" . $error);
            disable('problem', 'probid', $row['probid'], $error, $row['judgingid'], $row['cid']);
            return;
        }
        system(LIBJUDGEDIR . "/testcase_run.sh {$cpuset_opt} {$tcfile['input']} {$tcfile['output']} " . "{$row['maxruntime']}:{$hardtimelimit} '{$testcasedir}' " . "'{$run_runpath}' '{$compare_runpath}' '{$row['compare_args']}'", $retval);
        // what does the exitcode mean?
        if (!isset($EXITCODES[$retval])) {
            alert('error');
            error("Unknown exitcode from testcase_run.sh for s{$row['submitid']}, " . "testcase {$tc['rank']}: {$retval}");
        }
        $result = $EXITCODES[$retval];
        // Try to read metadata from file
        $runtime = NULL;
        if (is_readable($testcasedir . '/program.meta')) {
            $metadata = spyc_load_file($testcasedir . '/program.meta');
            if (isset($metadata['time-used'])) {
                $runtime = @$metadata[$metadata['time-used']];
            }
        }
        request('judging_runs', 'POST', 'judgingid=' . urlencode($row['judgingid']) . '&testcaseid=' . urlencode($tc['testcaseid']) . '&runresult=' . urlencode($result) . '&runtime=' . urlencode($runtime) . '&judgehost=' . urlencode($myhost) . '&output_run=' . rest_encode_file($testcasedir . '/program.out', FALSE) . '&output_error=' . rest_encode_file($testcasedir . '/program.err') . '&output_system=' . rest_encode_file($testcasedir . '/system.out') . '&output_diff=' . rest_encode_file($testcasedir . '/feedback/judgemessage.txt'));
        logmsg(LOG_DEBUG, "Testcase {$tc['rank']} done, result: " . $result);
    }
    // end: for each testcase
    // revoke readablity for domjudge-run user to this workdir
    chmod($workdir, 0700);
    // Optionally destroy chroot environment
    if (USE_CHROOT && CHROOT_SCRIPT) {
        logmsg(LOG_INFO, "executing chroot script: '" . CHROOT_SCRIPT . " stop'");
        system(LIBJUDGEDIR . '/' . CHROOT_SCRIPT . ' stop', $retval);
        if ($retval != 0) {
            error("chroot script exited with exitcode {$retval}");
        }
    }
    // Evict all contents of the workdir from the kernel fs cache
    system(LIBJUDGEDIR . "/evict {$workdir}", $retval);
    if ($retval != 0) {
        warning("evict script exited with exitcode {$retval}");
    }
    // Sanity check: need to have had at least one testcase
    if ($totalcases == 0) {
        logmsg(LOG_WARNING, "No testcases judged for s{$row['submitid']}/j{$row['judgingid']}!");
    }
    // done!
    logmsg(LOG_NOTICE, "Judging s{$row['submitid']}/j{$row['judgingid']} finished");
}
}
if (!$users->AsAnAdministratorGeneric) {
    writelogs("Redirect to users.index.php", __FUNCTION__, __FILE__, __LINE__);
    header('location:miniadm.php');
    exit;
}
if (isset($_GET["showInfos"])) {
    showInfos_js();
    exit;
}
if (isset($_GET["showInfos-id"])) {
    showInfos_popup();
    exit;
}
if (isset($_POST["disable"])) {
    disable();
    exit;
}
if (isset($_GET["left-menus-services"])) {
    left_menus_services();
    exit;
}
if (isset($_GET["left-menus-actions"])) {
    left_menus_actions();
    exit;
}
if ($GLOBALS["AS_ROOT"]) {
    page();
    left_menus_services();
    left_menus_actions();
    wizards();
Ejemplo n.º 5
0
 public function testDisable()
 {
     disable('off');
     $c = clone vicious\Config::instance();
     $this->assertFalse($c->off);
 }
Ejemplo n.º 6
0
	}
	else{
		$user = false;
	}

	if( $self == $user || $_SESSION['roleid'] < 3 ){
		if( $user->authentication->disabled ){
			if( enable($user->userid) ){
				header('Location: /' . $return . '.php?code=6');
			}
			else{
				header('Location: /' . $return . '.php?code=8');
			}
		}
		else{
			if( disable($user->userid) ){
				header('Location: /' . $return . '.php?code=5');
			}
			else{
				header('Location: /' . $return . '.php?code=7');
			}
		}
	}
	else{
		header('Location: /index.php?code=2');
	}

	function disable($id){
		return Authentication::disableByUserID($id);
	}
Ejemplo n.º 7
0
        clean();
        break;
    case 'reload':
        reload();
        break;
    case 'install':
        install($argv[2]);
        break;
    case 'uninstall':
        uninstall($argv[2]);
        break;
    case 'enable':
        enable($argv[2]);
        break;
    case 'disable':
        disable($argv[2]);
        break;
    case 'update':
        update($argv[2]);
        break;
    case 'check':
        break;
    default:
        print 'Unknown command ' . $cmd . "\n";
}
health_check();
exit;
function _apply($pattern, $func)
{
    $plugin_ids = array();
    if (strpos($pattern, '*') > -1) {
Ejemplo n.º 8
0
/**
 * @brief prints country drop-down list
 * @param $id the ID of the form (must be unique in the page)
 * @param $label the label associated to the drop-down list
 */
function printCountryDropDownList($id, $label)
{
    $countries = array("AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina", "BW" => "Botswana", "BV" => "Bouvet Island", "BR" => "Brazil", "IO" => "British Indian Ocean Territory", "BN" => "Brunei", "BG" => "Bulgaria", "BF" => "Burkina Faso", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos (Keeling) Islands", "CO" => "Colombia", "KM" => "Comoros", "CG" => "Congo", "CK" => "Cook Islands", "CR" => "Costa Rica", "CI" => "Côte d'Ivoire", "HR" => "Croatia (Hrvatska)", "CU" => "Cuba", "CY" => "Cyprus", "CZ" => "Czech Republic", "CD" => "Congo (DRC)", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "TP" => "East Timor", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands (Islas Malvinas)", "FO" => "Faroe Islands", "FJ" => "Fiji Islands", "FI" => "Finland", "FR" => "France", "GF" => "French Guiana", "PF" => "French Polynesia", "TF" => "French Southern and Antarctic Lands", "GA" => "Gabon", "GM" => "Gambia", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GP" => "Guadeloupe", "GU" => "Guam", "GT" => "Guatemala", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "HM" => "Heard Island and McDonald Islands", "HN" => "Honduras", "HK" => "Hong Kong SAR", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IR" => "Iran", "IQ" => "Iraq", "IE" => "Ireland", "IL" => "Israel", "IT" => "Italy", "JM" => "Jamaica", "JP" => "Japan", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", "KR" => "Korea", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Laos", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macao SAR", "MK" => "Macedonia, Former Yugoslav Republic of", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MQ" => "Martinique", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "MX" => "Mexico", "FM" => "Micronesia", "MD" => "Moldova", "MC" => "Monaco", "MN" => "Mongolia", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "MM" => "Myanmar", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", "NF" => "Norfolk Island", "KP" => "North Korea", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn Islands", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "RE" => "Reunion", "RO" => "Romania", "RU" => "Russia", "RW" => "Rwanda", "WS" => "Samoa", "SM" => "San Marino", "ST" => "São Tomé and Príncipe", "SA" => "Saudi Arabia", "SN" => "Senegal", "YU" => "Serbia and Montenegro", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "GS" => "South Georgia and the South Sandwich Islands", "ES" => "Spain", "LK" => "Sri Lanka", "SH" => "St. Helena", "KN" => "St. Kitts and Nevis", "LC" => "St. Lucia", "PM" => "St. Pierre and Miquelon", "VC" => "St. Vincent and the Grenadines", "SD" => "Sudan", "SR" => "Suriname", "SJ" => "Svalbard and Jan Mayen", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "SY" => "Syria", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "UK" => "United Kingdom", "US" => "United States", "UY" => "Uruguay", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VA" => "Vatican City", "VE" => "Venezuela", "VN" => "Viet Nam", "VG" => "Virgin Islands (British)", "VI" => "Virgin Islands", "WF" => "Wallis and Futuna", "YE" => "Yemen", "ZM" => "Zambia", "ZW" => "Zimbabwe");
    echo '<label for="' . $id . '">' . htmlentities($label) . ' :</label>' . "\n";
    echo '<select id="' . $id . '" name="' . $id . '" ';
    disable();
    echo '>' . "\n";
    foreach ($countries as $countryid => $name) {
        echo '<option value="' . $countryid . '" ';
        if (isset($_SESSION[$id]) ? $_SESSION[$id] == $countryid : strtolower($countryid) == "fr") {
            echo 'selected';
        }
        echo '>' . $name . '</option>' . "\n";
    }
    echo '</select>' . "\n";
    echo '<br />' . "\n";
}
Ejemplo n.º 9
0
        </div>
        <div id="form_paso_b">
            <h3>Crear Deportista: 2/4</h3>
            <hr>
            <div class="row">
                <div class="col-xs-12 col-md-6">
                    <div class="form-group">
                        <label for="toma medicamento" >¿Toma Medicamento de Forma Regular?:</label>
                        <label>                       
                            <?php 
echo $form->field($model, "medicamento")->radioList($a, ['style' => 'display:inline;', 'onclick' => 'activar_desactivar("desc_medicamento","ValidarDeportista[medicamento]")', 'separator' => ' '])->label(false);
?>
 
                        </label>                    
                        <?php 
echo $form->field($model, "desc_medicamento", ['enableAjaxValidation' => false])->input("text", ['id' => 'desc_medicamento', "placeholder" => "¿Cuales?", "class" => "form-control", "disabled" => disable($model['medicamento'])])->label(false);
?>
                    </div>

                    <div class="form-group">
                        <label for="alergia">Alergia:</label>
                        <label>                       
                            <?php 
echo $form->field($model, "alergia")->radioList($a, ['onclick' => 'activar_desactivar("desc_alergia","ValidarDeportista[alergia]")', 'style' => 'display:inline', 'separator' => ' '])->label(false);
?>
 
                        </label>
                        <?php 
echo $form->field($model, "desc_alergia")->input("text", ['id' => 'desc_alergia', "disabled" => "true", "placeholder" => "¿Cuales?", "class" => "form-control"])->label(false);
?>
                    </div>