Esempio n. 1
0
function get_option($name)
{
    $cache = Cache::get('system-options');
    if (empty($cache)) {
        $options = App\Option::get(['name', 'value']);
        foreach ($options as $option) {
            $data[$option->name] = $option->value;
        }
        Cache::forever('system-options', $data);
        $cache = Cache::get('system-options');
    }
    return htmlspecialchars_decode($cache[$name]);
}
    public function store(Request $request)
    {
        $personal_photo = \Input::file('personal_photo');
        $tphoto1_1 = \Input::file('tphoto1_1');
        $tphoto2_1 = \Input::file('tphoto2_1');
        $tphoto3_1 = \Input::file('tphoto3_1');
        $tphoto1_2 = \Input::file('tphoto1_2');
        $tphoto2_2 = \Input::file('tphoto2_2');
        $tphoto3_2 = \Input::file('tphoto3_2');
        $tphoto1_3 = \Input::file('tphoto1_3');
        $tphoto2_3 = \Input::file('tphoto2_3');
        $tphoto3_3 = \Input::file('tphoto3_3');
        if ($personal_photo != null) {
            $size = $personal_photo->getClientSize();
            if ($size <= 0 || $size > $personal_photo->getMaxFilesize() || $this->check($personal_photo)) {
                return view('error');
            }
        }
        if ($tphoto1_1 != null) {
            $size = $tphoto1_1->getClientSize();
            if ($size <= 0 || $size > $tphoto1_1->getMaxFilesize() || $this->check($tphoto1_1)) {
                return view('error');
            }
        }
        if ($tphoto2_1 != null) {
            $size = $tphoto2_1->getClientSize();
            if ($size <= 0 || $size > $tphoto2_1->getMaxFilesize() || $this->check($tphoto2_1)) {
                return view('error');
            }
        }
        if ($tphoto3_1 != null) {
            $size = $tphoto3_1->getClientSize();
            if ($size <= 0 || $size > $tphoto3_1->getMaxFilesize() || $this->check($tphoto3_1)) {
                return view('error');
            }
        }
        if ($tphoto1_2 != null) {
            $size = $tphoto1_2->getClientSize();
            if ($size <= 0 || $size > $tphoto1_2->getMaxFilesize() || $this->check($tphoto1_2)) {
                return view('error');
            }
        }
        if ($tphoto2_2 != null) {
            $size = $tphoto2_2->getClientSize();
            if ($size <= 0 || $size > $tphoto2_2->getMaxFilesize() || $this->check($tphoto2_2)) {
                return view('error');
            }
        }
        if ($tphoto3_2 != null) {
            $size = $tphoto3_2->getClientSize();
            if ($size <= 0 || $size > $tphoto3_2->getMaxFilesize() || $this->check($tphoto3_2)) {
                return view('error');
            }
        }
        if ($tphoto1_3 != null) {
            $size = $tphoto1_3->getClientSize();
            if ($size <= 0 || $size > $tphoto1_3->getMaxFilesize() || $this->check($tphoto1_3)) {
                return view('error');
            }
        }
        if ($tphoto2_3 != null) {
            $size = $tphoto2_3->getClientSize();
            if ($size <= 0 || $size > $tphoto2_3->getMaxFilesize() || $this->check($tphoto2_3)) {
                return view('error');
            }
        }
        if ($tphoto3_3 != null) {
            $size = $tphoto3_3->getClientSize();
            if ($size <= 0 || $size > $tphoto3_3->getMaxFilesize() || $this->check($tphoto3_3)) {
                return view('error');
            }
        }
        $email = $_POST['email'];
        $destinationPath = 'files';
        $clients = new \App\Client();
        $clients->fname = $_POST['fname'];
        $clients->lname = $_POST['lname'];
        $clients->nname = $_POST['nname'];
        $clients->email = $_POST['email'];
        $clients->city = $_POST['city'];
        $clients->state = $_POST['state'];
        $clients->zipcode = $_POST['zipcode'];
        $clients->gender = $_POST['gender'];
        $clients->phone_number = $_POST['phoneNum'];
        $clients->dob = $_POST['dob'];
        $clients->self_introduction = $_POST['self'];
        $clients->status = $_POST['status'];
        if ($personal_photo != null) {
            $name = '';
            $extension = $personal_photo->getClientOriginalName();
            $name .= $email;
            $name .= '_personal_photo_';
            $name .= $extension;
            $name = str_replace("@", "_", $name);
            $personal_photo->move($destinationPath, $name);
            $clients->personal_photo = $destinationPath . '\\';
            $clients->personal_photo .= $name;
        }
        $clients->save();
        if ($_POST['category1'] != null) {
            $talent = new \App\Talent();
            $talent->category = $_POST['category1'];
            $talent->specific_talent = $_POST['specific_talent1'];
            $talent->client_id = $clients->id;
            $talent->save();
            $audiolink = $_POST['audiolink1'];
            $videolink = $_POST['videolink1'];
            $portfolio = new \App\Portfolio();
            $portfolio->talent_id = $talent->id;
            if ($audiolink != null) {
                $portfolio->audio .= $audiolink;
            }
            if ($videolink != null) {
                $portfolio->video .= $videolink;
            }
            if ($tphoto1_1 != null) {
                $this->save_pic($portfolio, '_tphoto1_1_', $destinationPath, $tphoto1_1, $email);
            }
            if ($tphoto1_2 != null) {
                $this->save_pic($portfolio, '_tphoto1_2_', $destinationPath, $tphoto1_2, $email);
            }
            if ($tphoto1_3 != null) {
                $this->save_pic($portfolio, '_tphoto1_3_', $destinationPath, $tphoto1_3, $email);
            }
            $portfolio->photo = substr($portfolio->photo, 0, strlen($portfolio->photo) - 1);
            $portfolio->save();
        }
        if ($_POST['category2'] != null) {
            $talent = new \App\Talent();
            $talent->category = $_POST['category2'];
            $talent->specific_talent = $_POST['specific_talent2'];
            $talent->client_id = $clients->id;
            $talent->save();
            $audiolink = $_POST['audiolink2'];
            $videolink = $_POST['videolink2'];
            $portfolio = new \App\Portfolio();
            $portfolio->talent_id = $talent->id;
            if ($audiolink != null) {
                $portfolio->audio .= $audiolink;
            }
            if ($videolink != null) {
                $portfolio->video .= $videolink;
            }
            if ($tphoto2_1 != null) {
                $this->save_pic($portfolio, '_tphoto2_1_', $destinationPath, $tphoto2_1, $email);
            }
            if ($tphoto2_2 != null) {
                $this->save_pic($portfolio, '_tphoto2_2_', $destinationPath, $tphoto2_2, $email);
            }
            if ($tphoto2_3 != null) {
                $this->save_pic($portfolio, '_tphoto2_3_', $destinationPath, $tphoto2_3, $email);
            }
            $portfolio->photo = substr($portfolio->photo, 0, strlen($portfolio->photo) - 1);
            $portfolio->save();
        }
        if ($_POST['category3'] != null) {
            $talent = new \App\Talent();
            $talent->category = $_POST['category3'];
            $talent->specific_talent = $_POST['specific_talent3'];
            $talent->client_id = $clients->id;
            $talent->save();
            $audiolink = $_POST['audiolink3'];
            $videolink = $_POST['videolink3'];
            $portfolio = new \App\Portfolio();
            $portfolio->talent_id = $talent->id;
            if ($audiolink != null) {
                $portfolio->audio .= $audiolink;
            }
            if ($videolink != null) {
                $portfolio->video .= $videolink;
            }
            if ($tphoto3_1 != null) {
                $this->save_pic($portfolio, '_tphoto3_1_', $destinationPath, $tphoto3_1, $email);
            }
            if ($tphoto3_2 != null) {
                $this->save_pic($portfolio, '_tphoto3_2_', $destinationPath, $tphoto3_2, $email);
            }
            if ($tphoto3_3 != null) {
                $this->save_pic($portfolio, '_tphoto3_3_', $destinationPath, $tphoto3_3, $email);
            }
            $portfolio->photo = substr($portfolio->photo, 0, strlen($portfolio->photo) - 1);
            $portfolio->save();
        }
        $desire = new \App\Servicedesire();
        $desire->client_id = $clients->id;
        for ($i = 0; $i < sizeof($_POST['representation']); $i++) {
            if ($_POST['representation'][$i] != null) {
                $desire->representation .= $_POST['representation'][$i];
                if ($i < sizeof($_POST['representation']) - 1) {
                    $desire->representation .= ';';
                }
            }
        }
        for ($i = 0; $i < sizeof($_POST['opportunity']); $i++) {
            if ($_POST['opportunity'][$i] != null) {
                $desire->opportunity .= $_POST['opportunity'][$i];
                if ($i < sizeof($_POST['opportunity']) - 1) {
                    $desire->opportunity .= ';';
                }
            }
        }
        for ($i = 0; $i < sizeof($_POST['service']); $i++) {
            if ($_POST['service'][$i] != null) {
                $desire->service .= $_POST['service'][$i];
                if ($i < sizeof($_POST['service']) - 1) {
                    $desire->service .= ';';
                }
            }
        }
        $desire->save();
        $option = new \App\Option();
        $option->client_id = $clients->id;
        $option->describeword1 = $_POST['describeword1'];
        $option->describeword2 = $_POST['describeword2'];
        $option->describeword3 = $_POST['describeword3'];
        $option->intro_video = $_POST['introVideo'];
        $option->presonal_website = $_POST['personalWebsite'];
        $option->social_media = $_POST['socialMedia'];
        $option->accolades = $_POST['accolades'];
        $option->current_representation = $_POST['current_representation'];
        $option->experiences = $_POST['experience'];
        $option->anything = $_POST['anything'];
        $option->save();
        $subject = 'Thanks for your interest in Talentscool';
        $message = 'Hi there,' . "\r\n" . "\r\n" . 'Thank you for your interest in Talentscool! Our aim is to connect you to opportunities and service providers for your career.' . "\r\n" . "\r\n" . 'We have received your application and will be reviewing it shortly. A member of our team will be in contact with you as your application proceeds.
' . "\r\n" . "\r\n" . 'Thank you,' . "\r\n" . 'Talentscool Team';
        $headers = 'From: donotreply@talentscool.com' . "\r\n" . 'Reply-To: donotreply@talentscool.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        $flag = mail($email, $subject, $message, $headers);
        if ($flag) {
            return view('thanks');
        }
    }
 public function run()
 {
     $option = new App\Option();
     $option->client_id = 1;
     $option->describeword1 = "skilled";
     $option->describeword2 = "hard working";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->accolades = "music award";
     $option->experiences = "guitar list of a band";
     $option->save();
     $option = new App\Option();
     $option->client_id = 2;
     $option->describeword1 = "skilled";
     $option->describeword2 = "famous";
     $option->describeword3 = "fast";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->accolades = "Champions league, Most goal in la liga";
     $option->experiences = "Manchester United, Real Mardrid";
     $option->save();
     $option = new App\Option();
     $option->client_id = 3;
     $option->describeword1 = "skilled";
     $option->describeword2 = "famous";
     $option->describeword3 = "act";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->accolades = "Academy Awards, Golden Globes";
     $option->experiences = "Maleficent, Mr. & Mrs. Smith, Gia";
     $option->save();
     $option = new App\Option();
     $option->client_id = 4;
     $option->describeword1 = "awesome";
     $option->describeword2 = "famous";
     $option->describeword3 = "funny";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->accolades = "Academy Awards, Golden Globes";
     $option->experiences = "Lucy, The Avangers, Iron Man2";
     $option->save();
     $option = new App\Option();
     $option->client_id = 5;
     $option->describeword1 = "skilled";
     $option->describeword2 = "deaf";
     $option->describeword3 = "musician";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->experiences = "Symphony";
     $option->save();
     $option = new App\Option();
     $option->client_id = 6;
     $option->describeword1 = "skilled";
     $option->describeword2 = "famous";
     $option->describeword3 = "musician";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->experiences = "Symphony, Piano Sonata";
     $option->save();
     $option = new App\Option();
     $option->client_id = 7;
     $option->describeword1 = "skilled";
     $option->describeword2 = "guitar";
     $option->describeword3 = "musician";
     $option->intro_video = "https://www.youtube.com/embed/QcIy9NiNbmo";
     $option->accolades = "Grammy Award for Best Rock Instrument, Grammy Award for Best POP Instrument";
     $option->experiences = "The Yardbirds";
     $option->save();
 }
Esempio n. 4
0
                        <li class="list-group-item">
                            <a class="menu">
                                <span class="glyphicon glyphicon-th-list"></span>&nbsp;
                                &nbsp;
                                <?php 
$opt = DB::table('tbl_option_header')->where('id', $option->header)->first();
?>
                                {{ $opt->name }}
                            </a>
                            <?php 
$o = DB::table('tbl_useroption')->where('header', $option->header)->where('userid', $user)->orderBY('optionid', 'ASC')->get();
?>
                            
                            @foreach($o as $oo)
                                <?php 
$options = App\Option::find($oo->optionid);
?>
                                <ul class="sub-menu">
                                    <li class="li-sub-menu">
                                        <a class="menu" href="{{ url($options->link) }}">
                                            <span class="glyphicon glyphicon-chevron-right"></span>&nbsp;
                                            &nbsp;
                                            {{ $options->desc }}
                                        </a>
                                    </li>
                                </ul>
                            @endforeach

                        </li>
                    @endforeach